📝 Add term accept hint

This commit is contained in:
LittleSheep 2024-12-08 15:16:53 +08:00
parent 45f61533ee
commit 67feaacf5a
3 changed files with 47 additions and 3 deletions

View File

@ -413,5 +413,7 @@
"channelNewChannel": "New Channel",
"channelNewDirectMessage": "New Direct Message",
"channelDirectMessageDescription": "Direct Message with {}",
"fieldCannotBeEmpty": "This field cannot be empty."
"fieldCannotBeEmpty": "This field cannot be empty.",
"termAcceptLink": "View terms",
"termAcceptNextWithAgree": "By clicking the \"Next\", it means you agree to our terms and its updates."
}

View File

@ -413,5 +413,7 @@
"channelNewChannel": "新建频道",
"channelNewDirectMessage": "发起私信",
"channelDirectMessageDescription": "与 {} 的私聊",
"fieldCannotBeEmpty": "此字段不能为空。"
"fieldCannotBeEmpty": "此字段不能为空。",
"termAcceptLink": "浏览条款",
"termAcceptNextWithAgree": "点击 “下一步”,即表示你同意我们的各项条款,包括其之后的更新。"
}

View File

@ -8,6 +8,7 @@ import 'package:provider/provider.dart';
import 'package:styled_widget/styled_widget.dart';
import 'package:surface/providers/sn_network.dart';
import 'package:surface/widgets/dialog.dart';
import 'package:url_launcher/url_launcher_string.dart';
class RegisterScreen extends StatefulWidget {
const RegisterScreen({super.key});
@ -167,6 +168,45 @@ class _RegisterScreenState extends State<RegisterScreen> {
).padding(horizontal: 7),
),
const Gap(16),
Align(
alignment: Alignment.centerRight,
child: StyledWidget(
Container(
constraints: const BoxConstraints(maxWidth: 290),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
'termAcceptNextWithAgree'.tr(),
textAlign: TextAlign.end,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: Theme.of(context)
.colorScheme
.onSurface
.withAlpha((255 * 0.75).round()),
),
),
Material(
color: Colors.transparent,
child: InkWell(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text('termAcceptLink'.tr()),
const Gap(4),
const Icon(Symbols.launch, size: 14),
],
),
onTap: () {
launchUrlString('https://solsynth.dev/terms');
},
),
),
],
),
),
).padding(horizontal: 16),
),
Align(
alignment: Alignment.centerRight,
child: TextButton(
@ -179,7 +219,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
],
),
),
)
),
],
),
),