Format code

Serhii committed Dec 14, 2023 at 18:41 UTC 95a1291704fdc3b40c7deb61df361aba66fd2876
2 files changed +54 -27
lib/src/screens/seed/warning_page.dart
+16 -9
@@ -21,7 +21,8 @@ class WarningPage extends BasePage {
21 final bool isPreSeedPage;
22
23 @override
24 - Widget? leading(BuildContext context) => isPreSeedPage ? null : super.leading(context);
24 + Widget? leading(BuildContext context) =>
25 + isPreSeedPage ? null : super.leading(context);
26
27 @override
28 String? get title => S.current.pre_seed_title;
@@ -36,14 +37,15 @@ class WarningPage extends BasePage {
37 alignment: Alignment.center,
38 padding: EdgeInsets.all(24),
39 child: ConstrainedBox(
39 - constraints:
40 - BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
40 + constraints: BoxConstraints(
41 + maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
42 child: Column(
43 mainAxisAlignment: MainAxisAlignment.spaceBetween,
44 children: <Widget>[
45 Expanded(
46 child: ConstrainedBox(
46 - constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3),
47 + constraints: BoxConstraints(
48 + maxHeight: MediaQuery.of(context).size.height * 0.3),
49 child: AspectRatio(aspectRatio: 1, child: image),
50 ),
51 ),
@@ -52,20 +54,25 @@ class WarningPage extends BasePage {
54 padding: EdgeInsets.all(10),
55 child: Text(
56 isPreSeedPage
55 - ? S.of(context).pre_seed_description(seedPhraseLength.toString())
57 + ? S.of(context).pre_seed_description(
58 + seedPhraseLength.toString())
59 : S.of(context).setup_warning_2fa_text,
60 textAlign: TextAlign.center,
61 style: TextStyle(
59 - height: 1.7,
62 + height: 1.7,
63 fontSize: 14,
64 fontWeight: FontWeight.normal,
62 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor)),
65 + color: Theme.of(context)
66 + .extension<CakeTextTheme>()!
67 + .secondaryTextColor)),
68 ),
69 ),
70 PrimaryButton(
71 onPressed: () => isPreSeedPage
67 - ? Navigator.of(context).popAndPushNamed(Routes.seed, arguments: true)
68 - : Navigator.of(context).popAndPushNamed(Routes.setup_2faPage),
72 + ? Navigator.of(context)
73 + .popAndPushNamed(Routes.seed, arguments: true)
74 + : Navigator.of(context)
75 + .popAndPushNamed(Routes.setup_2faPage),
76 text: isPreSeedPage
77 ? S.of(context).pre_seed_button_text
78 : S.of(context).understand,
lib/src/screens/setup_2fa/setup_2fa_qr_page.dart
+38 -18
@@ -26,7 +26,9 @@ class Setup2FAQRPage extends BasePage {
26 @override
27 Widget body(BuildContext context) {
28 final copyImage = Image.asset('assets/images/copy_content.png',
29 - height: 16, width: 16, color: Theme.of(context).extension<CakeTextTheme>()!.titleColor);
29 + height: 16,
30 + width: 16,
31 + color: Theme.of(context).extension<CakeTextTheme>()!.titleColor);
32 final cake2FAHowToUseUrl = Uri.parse(
33 'https://guides.cakewallet.com/docs/advanced-features/authentication/#enabling-cake-2fa');
34 return Padding(
@@ -45,7 +47,8 @@ class Setup2FAQRPage extends BasePage {
47 ),
48 SizedBox(height: 10),
49 ConstrainedBox(
48 - constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.4),
50 + constraints: BoxConstraints(
51 + maxHeight: MediaQuery.of(context).size.height * 0.4),
52 child: AspectRatio(
53 aspectRatio: 1.0,
54 child: Container(
@@ -53,14 +56,17 @@ class Setup2FAQRPage extends BasePage {
56 decoration: BoxDecoration(
57 border: Border.all(
58 width: 3,
56 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
59 + color: Theme.of(context)
60 + .extension<CakeTextTheme>()!
61 + .titleColor,
62 ),
63 ),
64 child: Container(
65 child: QrImage(
66 data: setup2FAViewModel.totpVersionOneLink,
67 version: qr.QrVersions.auto,
63 - foregroundColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
68 + foregroundColor:
69 + Theme.of(context).extension<CakeTextTheme>()!.titleColor,
70 backgroundColor: Colors.transparent,
71 )),
72 ),
@@ -90,7 +96,9 @@ class Setup2FAQRPage extends BasePage {
96 style: TextStyle(
97 fontSize: 12,
98 fontWeight: FontWeight.w500,
93 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
99 + color: Theme.of(context)
100 + .extension<CakeTextTheme>()!
101 + .secondaryTextColor,
102 height: 1.8333,
103 ),
104 ),
@@ -99,7 +107,9 @@ class Setup2FAQRPage extends BasePage {
107 '${setup2FAViewModel.totpSecretKey}',
108 style: TextStyle(
109 fontSize: 18,
102 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
110 + color: Theme.of(context)
111 + .extension<CakeTextTheme>()!
112 + .titleColor),
113 maxLines: 1,
114 overflow: TextOverflow.ellipsis,
115 ),
@@ -112,8 +122,8 @@ class Setup2FAQRPage extends BasePage {
122 height: 32,
123 child: InkWell(
124 onTap: () {
115 - ClipboardUtil.setSensitiveDataToClipboard(
116 - ClipboardData(text: '${setup2FAViewModel.totpSecretKey}'));
125 + ClipboardUtil.setSensitiveDataToClipboard(ClipboardData(
126 + text: '${setup2FAViewModel.totpSecretKey}'));
127 showBar<void>(context, S.of(context).copied_to_clipboard);
128 },
129 child: Container(
@@ -140,7 +150,9 @@ class Setup2FAQRPage extends BasePage {
150 style: TextStyle(
151 fontSize: 12,
152 fontWeight: FontWeight.w500,
143 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
153 + color: Theme.of(context)
154 + .extension<CakeTextTheme>()!
155 + .secondaryTextColor,
156 height: 1.8333,
157 ),
158 ),
@@ -149,7 +161,9 @@ class Setup2FAQRPage extends BasePage {
161 '${setup2FAViewModel.totpVersionOneLink}',
162 style: TextStyle(
163 fontSize: 18,
152 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
164 + color: Theme.of(context)
165 + .extension<CakeTextTheme>()!
166 + .titleColor),
167 maxLines: 1,
168 overflow: TextOverflow.ellipsis,
169 ),
@@ -162,8 +176,8 @@ class Setup2FAQRPage extends BasePage {
176 height: 32,
177 child: InkWell(
178 onTap: () {
165 - ClipboardUtil.setSensitiveDataToClipboard(
166 - ClipboardData(text: '${setup2FAViewModel.totpVersionOneLink}'));
179 + ClipboardUtil.setSensitiveDataToClipboard(ClipboardData(
180 + text: '${setup2FAViewModel.totpVersionOneLink}'));
181 showBar<void>(context, S.of(context).copied_to_clipboard);
182 },
183 child: Container(
@@ -187,18 +201,24 @@ class Setup2FAQRPage extends BasePage {
201 decoration: TextDecoration.underline,
202 fontSize: 16,
203 fontWeight: FontWeight.w500,
190 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor)),
204 + color: Theme.of(context)
205 + .extension<CakeTextTheme>()!
206 + .titleColor)),
207 Icon(Icons.info_outline,
192 - size: 20, color: Theme.of(context).extension<CakeTextTheme>()!.titleColor)
208 + size: 20,
209 + color: Theme.of(context)
210 + .extension<CakeTextTheme>()!
211 + .titleColor)
212 ],
213 )),
214 Spacer(flex: 5),
215 PrimaryButton(
216 onPressed: () {
198 - Navigator.of(context).pushReplacementNamed(Routes.totpAuthCodePage,
199 - arguments: TotpAuthArgumentsModel(
200 - isForSetup: true,
201 - ));
217 + Navigator.of(context)
218 + .pushReplacementNamed(Routes.totpAuthCodePage,
219 + arguments: TotpAuthArgumentsModel(
220 + isForSetup: true,
221 + ));
222 },
223 text: S.current.continue_text,
224 color: Theme.of(context).primaryColor,