diff --git a/lib/main.dart b/lib/main.dart index 9c3980aa17..0e02ef97b1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -284,7 +284,7 @@ class AppState extends State with SingleTickerProviderStateMixin { final statusBarColor = Colors.transparent; final authenticationStore = getIt.get(); final initialRoute = authenticationStore.state == AuthenticationState.uninitialized - ? Routes.disclaimer + ? Routes.welcome : Routes.login; final currentTheme = settingsStore.currentTheme; final statusBarBrightness = diff --git a/lib/src/screens/disclaimer/disclaimer_page.dart b/lib/src/screens/disclaimer/disclaimer_page.dart index c9d959b406..a7d3b5ff9f 100644 --- a/lib/src/screens/disclaimer/disclaimer_page.dart +++ b/lib/src/screens/disclaimer/disclaimer_page.dart @@ -41,7 +41,6 @@ class DisclaimerPageBody extends StatefulWidget { } class DisclaimerBodyState extends State { - static const changenowUrl = 'https://changenow.io/terms-of-use'; bool _checked = false; String _fileText = ''; @@ -63,7 +62,7 @@ class DisclaimerBodyState extends State { @override Widget build(BuildContext context) { return WillPopScope( - onWillPop: () async => false, + onWillPop: () async => widget.isReadOnly, child: Container( color: Theme.of(context).colorScheme.background, child: Column( @@ -125,49 +124,6 @@ class DisclaimerBodyState extends State { SizedBox( height: 16.0, ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: Text( - 'Other Terms and Conditions', - textAlign: TextAlign.left, - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.bold, - color: Theme.of(context).extension()!.titleColor), - ), - ) - ], - ), - SizedBox( - height: 16.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: GestureDetector( - onTap: () async { - final uri = Uri.parse(changenowUrl); - if (await canLaunchUrl(uri)) - await launchUrl(uri, mode: LaunchMode.externalApplication); - }, - child: Text( - changenowUrl, - textAlign: TextAlign.left, - style: TextStyle( - color: Theme.of(context).primaryColor, - fontSize: 14.0, - fontWeight: FontWeight.normal, - decoration: TextDecoration.underline), - ), - )) - ], - ), - SizedBox( - height: 16.0, - ) ], ), ), diff --git a/lib/src/screens/welcome/create_pin_welcome_page.dart b/lib/src/screens/welcome/create_pin_welcome_page.dart index 5a881a20b0..ddf3b8d5ba 100644 --- a/lib/src/screens/welcome/create_pin_welcome_page.dart +++ b/lib/src/screens/welcome/create_pin_welcome_page.dart @@ -2,6 +2,7 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/utils/responsive_layout_util.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; @@ -68,7 +69,7 @@ class CreatePinWelcomePage extends BasePage { alignment: Alignment.center, child: ConstrainedBox( constraints: - BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint), + BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -122,19 +123,44 @@ class CreatePinWelcomePage extends BasePage { ), ), ), - bottomSection: Padding( - padding: EdgeInsets.only(top: 24), - child: PrimaryImageButton( - key: ValueKey('create_pin_welcome_page_create_a_pin_button_key'), - onPressed: () => Navigator.pushNamed(context, Routes.welcomeWallet), - image: newWalletImage, - text: isWalletPasswordDirectInput ? S.current.set_up_a_wallet : S.current.set_a_pin, - color: Theme.of(context) - .extension()! - .createNewWalletButtonBackgroundColor, - textColor: - Theme.of(context).extension()!.restoreWalletButtonTextColor, - ), + bottomSection: Column( + children: [ + RichText( + textAlign: TextAlign.center, + text: TextSpan( + style: TextStyle( + fontSize: 14, + color: Theme.of(context).extension()!.hintTextColor, + ), + children: [ + TextSpan(text: 'By continuing, you agree to our '), + TextSpan( + text: 'Terms of Service', + style: TextStyle( + color: Theme.of(context).primaryColor, + decoration: TextDecoration.underline, + ), + recognizer: TapGestureRecognizer() + ..onTap = () => Navigator.pushNamed(context, Routes.readDisclaimer), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only(top: 24), + child: PrimaryImageButton( + key: ValueKey('create_pin_welcome_page_create_a_pin_button_key'), + onPressed: () => Navigator.pushNamed(context, Routes.welcomeWallet), + image: newWalletImage, + text: isWalletPasswordDirectInput ? S.current.set_up_a_wallet : S.current.set_a_pin, + color: Theme.of(context) + .extension()! + .createNewWalletButtonBackgroundColor, + textColor: + Theme.of(context).extension()!.restoreWalletButtonTextColor, + ), + ), + ], ), ), );