From 306e4671b4aedf3699c7daaa24cae7f9c2482726 Mon Sep 17 00:00:00 2001 From: Serhii Date: Tue, 21 Nov 2023 14:46:11 +0200 Subject: [PATCH] add 2fa guid and how to use sections --- lib/src/screens/setup_2fa/setup_2fa.dart | 10 +++++++++- .../screens/setup_2fa/setup_2fa_qr_page.dart | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/src/screens/setup_2fa/setup_2fa.dart b/lib/src/screens/setup_2fa/setup_2fa.dart index 895fbb9c0..3bdd49f5b 100644 --- a/lib/src/screens/setup_2fa/setup_2fa.dart +++ b/lib/src/screens/setup_2fa/setup_2fa.dart @@ -19,6 +19,9 @@ class Setup2FAPage extends BasePage { @override Widget body(BuildContext context) { + final cake2FAGuideTitle = 'Cake 2FA Guide'; + final cake2FAGuideUri = + Uri.parse('https://guides.cakewallet.com/docs/advanced-features/authentication'); return SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -50,7 +53,7 @@ class Setup2FAPage extends BasePage { ], ), ), - SizedBox(height: 86), + SizedBox(height: 56), SettingsCellWithArrow( title: S.current.setup_totp_recommended, handler: (_) { @@ -59,6 +62,11 @@ class Setup2FAPage extends BasePage { }, ), StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)), + SettingsCellWithArrow( + title: cake2FAGuideTitle, + handler: (_) => Navigator.of(context) + .pushNamed(Routes.webViewPage, arguments: [cake2FAGuideTitle, cake2FAGuideUri])), + StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)), ], ), ); diff --git a/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart b/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart index 43dbab05f..a50c64aa0 100644 --- a/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart +++ b/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart @@ -30,6 +30,9 @@ class Setup2FAQRPage extends BasePage { width: 12, color: Color(0xFF355688), ); + final cake2FAHowToUseTitle = 'How to use'; + final cake2FAHowToUseUrl = Uri.parse( + 'https://guides.cakewallet.com/docs/advanced-features/authentication/#enabling-cake-2fa'); return Padding( padding: const EdgeInsets.symmetric(horizontal: 24), child: Column( @@ -180,6 +183,23 @@ class Setup2FAQRPage extends BasePage { ), SizedBox(height: 8), StandardListSeparator(), + SizedBox(height: 16), + GestureDetector( + onTap: () => Navigator.of(context).pushNamed(Routes.webViewPage, + arguments: [cake2FAHowToUseTitle, cake2FAHowToUseUrl]), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(cake2FAHowToUseTitle, + style: TextStyle( + decoration: TextDecoration.underline, + fontSize: 16, + fontWeight: FontWeight.w700, + )), + Icon(Icons.info_outline,size: 20) + ], + )), Spacer(), PrimaryButton( onPressed: () {