1
+import 'package:cake_wallet/routes.dart';
2
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
4
import 'package:cake_wallet/themes/theme_base.dart';
16
import 'package:cake_wallet/src/screens/base_page.dart';
17
import 'package:cake_wallet/view_model/wallet_seed_view_model.dart';
18
18
-import '../../../themes/extensions/menu_theme.dart';
19
+import '../../../themes/extensions/send_page_theme.dart';
20
21
class WalletSeedPage extends BasePage {
22
WalletSeedPage(this.walletSeedViewModel, {required this.isNewWalletCreated});
30
final bool isNewWalletCreated;
31
final WalletSeedViewModel walletSeedViewModel;
32
32
- @override
33
- void onClose(BuildContext context) async {
34
- if (isNewWalletCreated) {
35
- final confirmed = await showPopUp<bool>(
36
- context: context,
37
- builder: (BuildContext context) {
38
- return AlertWithTwoActions(
39
- alertDialogKey: ValueKey('wallet_seed_page_seed_alert_dialog_key'),
40
- alertRightActionButtonKey:
41
- ValueKey('wallet_seed_page_seed_alert_confirm_button_key'),
42
- alertLeftActionButtonKey: ValueKey('wallet_seed_page_seed_alert_back_button_key'),
43
- alertTitle: S.of(context).seed_alert_title,
44
- alertContent: S.of(context).seed_alert_content,
45
- leftButtonText: S.of(context).seed_alert_back,
46
- rightButtonText: S.of(context).seed_alert_yes,
47
- actionLeftButton: () => Navigator.of(context).pop(false),
48
- actionRightButton: () => Navigator.of(context).pop(true),
49
- );
50
- },
51
- ) ??
52
- false;
53
-
54
- if (confirmed) {
55
- Navigator.of(context).popUntil((route) => route.isFirst);
56
- }
57
-
58
- return;
59
- }
60
-
61
- Navigator.of(context).pop();
62
- }
63
-
64
- @override
65
- Widget? leading(BuildContext context) => isNewWalletCreated ? null : super.leading(context);
66
-
33
@override
34
Widget trailing(BuildContext context) {
35
+ final copyImage = Image.asset(
36
+ 'assets/images/copy_address.png',
37
+ color: Theme.of(context)
38
+ .extension<CakeTextTheme>()!
39
+ .buttonTextColor
40
+ );
41
+
42
return isNewWalletCreated
43
? GestureDetector(
71
- key: ValueKey('wallet_seed_page_next_button_key'),
72
- onTap: () => onClose(context),
44
+ key: ValueKey('wallet_seed_page_copy_seeds_button_key'),
45
+ onTap: () {
46
+ ClipboardUtil.setSensitiveDataToClipboard(
47
+ ClipboardData(text: walletSeedViewModel.seed),
48
+ );
49
+ showBar<void>(context, S.of(context).copied_to_clipboard);
50
+ },
51
child: Container(
74
- width: 100,
75
- height: 32,
52
+ padding: EdgeInsets.all(8),
53
+ width: 40,
54
alignment: Alignment.center,
55
margin: EdgeInsets.only(left: 10),
56
decoration: BoxDecoration(
79
- borderRadius: BorderRadius.all(Radius.circular(16)),
80
- color: Theme.of(context).cardColor),
81
- child: Text(
82
- S.of(context).seed_language_next,
83
- style: TextStyle(
84
- fontSize: 14,
85
- fontWeight: FontWeight.w600,
86
- color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor),
57
+ borderRadius: BorderRadius.all(Radius.circular(8)),
58
+ color: Theme.of(context).cardColor,
59
),
60
+ child: copyImage,
61
),
62
)
63
: Offstage();
68
return WillPopScope(
69
onWillPop: () async => false,
70
child: Container(
98
- padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8),
71
+ padding: EdgeInsets.symmetric(horizontal: 14, vertical: 8),
72
alignment: Alignment.center,
73
child: ConstrainedBox(
74
constraints:
102
size: 64,
103
color: Colors.white.withOpacity(0.75),
104
),
132
- SizedBox(width: 8),
105
+ SizedBox(width: 6),
106
Expanded(
107
child: Text(
108
S.current.cake_seeds_save_disclaimer,
119
],
120
),
121
),
149
- SizedBox(height: 32),
122
+ SizedBox(height: 20),
123
Text(
124
key: ValueKey('wallet_seed_page_wallet_name_text_key'),
125
walletSeedViewModel.name,
126
style: TextStyle(
154
- fontSize: 20,
127
+ fontSize: 18,
128
fontWeight: FontWeight.w600,
129
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
130
),
131
),
159
- SizedBox(height: 24),
132
+ SizedBox(height: 20),
133
Expanded(
134
child: GridView.builder(
162
- padding: const EdgeInsets.symmetric(horizontal: 4),
135
itemCount: walletSeedViewModel.seedSplit.length,
136
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
165
- crossAxisCount: walletSeedViewModel.columnCount,
166
- childAspectRatio: 3.6,
137
+ crossAxisCount: 3,
138
+ childAspectRatio: 2.8,
139
mainAxisSpacing: 8.0,
140
crossAxisSpacing: 8.0,
141
),
144
final numberCount = index + 1;
145
146
return Container(
175
- padding: const EdgeInsets.symmetric(horizontal: 4),
147
+ padding: const EdgeInsets.symmetric(horizontal: 8),
148
alignment: Alignment.center,
149
decoration: BoxDecoration(
150
borderRadius: BorderRadius.circular(8),
154
crossAxisAlignment: CrossAxisAlignment.center,
155
children: [
156
SizedBox(
185
- width: 20,
157
child: Text(
158
+ //maxLines: 1,
159
numberCount.toString(),
188
- textAlign: TextAlign.right,
160
+ textAlign: TextAlign.center,
161
style: TextStyle(
190
- fontSize: 14,
191
- fontWeight: FontWeight.w700,
162
+ fontSize: 12,
163
+ height: 1,
164
+ fontWeight: FontWeight.w800,
165
color: Theme.of(context)
166
.extension<CakeTextTheme>()!
167
.buttonTextColor
168
.withOpacity(0.5)),
169
),
170
),
198
- const SizedBox(width: 8),
171
+ const SizedBox(width: 6),
172
Expanded(
173
child: Text(
201
- '${item[0].toUpperCase()}${item.substring(1)}',
174
+ '${item[0].toLowerCase()}${item.substring(1)}',
175
style: TextStyle(
176
fontSize: 14,
177
+ height: 0.8,
178
fontWeight: FontWeight.w700,
179
color: Theme.of(context)
180
.extension<CakeTextTheme>()!
199
children: <Widget>[
200
Flexible(
201
child: Container(
228
- padding: EdgeInsets.only(right: 8.0),
202
+ padding: EdgeInsets.only(right: 8.0, top: 8.0),
203
child: PrimaryButton(
204
key: ValueKey('wallet_seed_page_save_seeds_button_key'),
205
onPressed: () {
218
),
219
Flexible(
220
child: Container(
247
- padding: EdgeInsets.only(left: 8.0),
221
+ padding: EdgeInsets.only(left: 8.0, top: 8.0),
222
child: Builder(
223
builder: (context) => PrimaryButton(
250
- key: ValueKey('wallet_seed_page_copy_seeds_button_key'),
251
- onPressed: () {
252
- ClipboardUtil.setSensitiveDataToClipboard(
253
- ClipboardData(text: walletSeedViewModel.seed),
254
- );
255
- showBar<void>(context, S.of(context).copied_to_clipboard);
256
- },
257
- text: S.of(context).copy,
224
+ key: ValueKey('wallet_seed_page_verify_seed_button_key'),
225
+ onPressed: () =>
226
+ Navigator.pushNamed(context, Routes.walletSeedVerificationPage),
227
+ text: S.current.verify_seed,
228
color: Theme.of(context).primaryColor,
229
textColor: Colors.white,
230
),
233
)
234
],
235
),
266
- SizedBox(height: 24),
236
+ SizedBox(height: 12),
237
],
238
)
239
],