From 95a1291704fdc3b40c7deb61df361aba66fd2876 Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 14 Dec 2023 18:41:43 +0200 Subject: [PATCH] Format code --- lib/src/screens/seed/warning_page.dart | 25 ++++++--- .../screens/setup_2fa/setup_2fa_qr_page.dart | 56 +++++++++++++------ 2 files changed, 54 insertions(+), 27 deletions(-) diff --git a/lib/src/screens/seed/warning_page.dart b/lib/src/screens/seed/warning_page.dart index f29f69a05..18b9b6248 100644 --- a/lib/src/screens/seed/warning_page.dart +++ b/lib/src/screens/seed/warning_page.dart @@ -21,7 +21,8 @@ class WarningPage extends BasePage { final bool isPreSeedPage; @override - Widget? leading(BuildContext context) => isPreSeedPage ? null : super.leading(context); + Widget? leading(BuildContext context) => + isPreSeedPage ? null : super.leading(context); @override String? get title => S.current.pre_seed_title; @@ -36,14 +37,15 @@ class WarningPage extends BasePage { alignment: Alignment.center, padding: EdgeInsets.all(24), child: ConstrainedBox( - constraints: - BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint), + constraints: BoxConstraints( + maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( child: ConstrainedBox( - constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3), + constraints: BoxConstraints( + maxHeight: MediaQuery.of(context).size.height * 0.3), child: AspectRatio(aspectRatio: 1, child: image), ), ), @@ -52,20 +54,25 @@ class WarningPage extends BasePage { padding: EdgeInsets.all(10), child: Text( isPreSeedPage - ? S.of(context).pre_seed_description(seedPhraseLength.toString()) + ? S.of(context).pre_seed_description( + seedPhraseLength.toString()) : S.of(context).setup_warning_2fa_text, textAlign: TextAlign.center, style: TextStyle( - height: 1.7, + height: 1.7, fontSize: 14, fontWeight: FontWeight.normal, - color: Theme.of(context).extension()!.secondaryTextColor)), + color: Theme.of(context) + .extension()! + .secondaryTextColor)), ), ), PrimaryButton( onPressed: () => isPreSeedPage - ? Navigator.of(context).popAndPushNamed(Routes.seed, arguments: true) - : Navigator.of(context).popAndPushNamed(Routes.setup_2faPage), + ? Navigator.of(context) + .popAndPushNamed(Routes.seed, arguments: true) + : Navigator.of(context) + .popAndPushNamed(Routes.setup_2faPage), text: isPreSeedPage ? S.of(context).pre_seed_button_text : S.of(context).understand, 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 86fabae13..3ce10b596 100644 --- a/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart +++ b/lib/src/screens/setup_2fa/setup_2fa_qr_page.dart @@ -26,7 +26,9 @@ class Setup2FAQRPage extends BasePage { @override Widget body(BuildContext context) { final copyImage = Image.asset('assets/images/copy_content.png', - height: 16, width: 16, color: Theme.of(context).extension()!.titleColor); + height: 16, + width: 16, + color: Theme.of(context).extension()!.titleColor); final cake2FAHowToUseUrl = Uri.parse( 'https://guides.cakewallet.com/docs/advanced-features/authentication/#enabling-cake-2fa'); return Padding( @@ -45,7 +47,8 @@ class Setup2FAQRPage extends BasePage { ), SizedBox(height: 10), ConstrainedBox( - constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.4), + constraints: BoxConstraints( + maxHeight: MediaQuery.of(context).size.height * 0.4), child: AspectRatio( aspectRatio: 1.0, child: Container( @@ -53,14 +56,17 @@ class Setup2FAQRPage extends BasePage { decoration: BoxDecoration( border: Border.all( width: 3, - color: Theme.of(context).extension()!.titleColor, + color: Theme.of(context) + .extension()! + .titleColor, ), ), child: Container( child: QrImage( data: setup2FAViewModel.totpVersionOneLink, version: qr.QrVersions.auto, - foregroundColor: Theme.of(context).extension()!.titleColor, + foregroundColor: + Theme.of(context).extension()!.titleColor, backgroundColor: Colors.transparent, )), ), @@ -90,7 +96,9 @@ class Setup2FAQRPage extends BasePage { style: TextStyle( fontSize: 12, fontWeight: FontWeight.w500, - color: Theme.of(context).extension()!.secondaryTextColor, + color: Theme.of(context) + .extension()! + .secondaryTextColor, height: 1.8333, ), ), @@ -99,7 +107,9 @@ class Setup2FAQRPage extends BasePage { '${setup2FAViewModel.totpSecretKey}', style: TextStyle( fontSize: 18, - color: Theme.of(context).extension()!.titleColor), + color: Theme.of(context) + .extension()! + .titleColor), maxLines: 1, overflow: TextOverflow.ellipsis, ), @@ -112,8 +122,8 @@ class Setup2FAQRPage extends BasePage { height: 32, child: InkWell( onTap: () { - ClipboardUtil.setSensitiveDataToClipboard( - ClipboardData(text: '${setup2FAViewModel.totpSecretKey}')); + ClipboardUtil.setSensitiveDataToClipboard(ClipboardData( + text: '${setup2FAViewModel.totpSecretKey}')); showBar(context, S.of(context).copied_to_clipboard); }, child: Container( @@ -140,7 +150,9 @@ class Setup2FAQRPage extends BasePage { style: TextStyle( fontSize: 12, fontWeight: FontWeight.w500, - color: Theme.of(context).extension()!.secondaryTextColor, + color: Theme.of(context) + .extension()! + .secondaryTextColor, height: 1.8333, ), ), @@ -149,7 +161,9 @@ class Setup2FAQRPage extends BasePage { '${setup2FAViewModel.totpVersionOneLink}', style: TextStyle( fontSize: 18, - color: Theme.of(context).extension()!.titleColor), + color: Theme.of(context) + .extension()! + .titleColor), maxLines: 1, overflow: TextOverflow.ellipsis, ), @@ -162,8 +176,8 @@ class Setup2FAQRPage extends BasePage { height: 32, child: InkWell( onTap: () { - ClipboardUtil.setSensitiveDataToClipboard( - ClipboardData(text: '${setup2FAViewModel.totpVersionOneLink}')); + ClipboardUtil.setSensitiveDataToClipboard(ClipboardData( + text: '${setup2FAViewModel.totpVersionOneLink}')); showBar(context, S.of(context).copied_to_clipboard); }, child: Container( @@ -187,18 +201,24 @@ class Setup2FAQRPage extends BasePage { decoration: TextDecoration.underline, fontSize: 16, fontWeight: FontWeight.w500, - color: Theme.of(context).extension()!.titleColor)), + color: Theme.of(context) + .extension()! + .titleColor)), Icon(Icons.info_outline, - size: 20, color: Theme.of(context).extension()!.titleColor) + size: 20, + color: Theme.of(context) + .extension()! + .titleColor) ], )), Spacer(flex: 5), PrimaryButton( onPressed: () { - Navigator.of(context).pushReplacementNamed(Routes.totpAuthCodePage, - arguments: TotpAuthArgumentsModel( - isForSetup: true, - )); + Navigator.of(context) + .pushReplacementNamed(Routes.totpAuthCodePage, + arguments: TotpAuthArgumentsModel( + isForSetup: true, + )); }, text: S.current.continue_text, color: Theme.of(context).primaryColor,