diff --git a/assets/translations/en.json b/assets/translations/en.json index 7df810c..db1cab0 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -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." } diff --git a/assets/translations/zh.json b/assets/translations/zh.json index 3259701..6931da4 100644 --- a/assets/translations/zh.json +++ b/assets/translations/zh.json @@ -413,5 +413,7 @@ "channelNewChannel": "新建频道", "channelNewDirectMessage": "发起私信", "channelDirectMessageDescription": "与 {} 的私聊", - "fieldCannotBeEmpty": "此字段不能为空。" + "fieldCannotBeEmpty": "此字段不能为空。", + "termAcceptLink": "浏览条款", + "termAcceptNextWithAgree": "点击 “下一步”,即表示你同意我们的各项条款,包括其之后的更新。" } diff --git a/lib/screens/auth/register.dart b/lib/screens/auth/register.dart index e8ec7fb..ced7a3c 100644 --- a/lib/screens/auth/register.dart +++ b/lib/screens/auth/register.dart @@ -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 { ).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 { ], ), ), - ) + ), ], ), ),