CWA-205 | applied new design to restore_from_keys_page, restore_wallet_from_seed_page, restore_wallet_from_seed_details, seed_widget, blockchain_height_widget; created top_panel widget and restore_alert_dialog
Oleksandr Sobol committed
May 1, 2020 at 18:57 UTC
3180ab65e145d7a7e0c1011491e02e23309cb764
30 files changed
+590
-304
lib/generated/i18n.dart
+47
-1
@@ -125,18 +125,20 @@ class S implements WidgetsLocalizations {
125
String get remove_node_message => "Are you sure that you want to remove selected node?";
126
String get rescan => "Rescan";
127
String get reset => "Reset";
128
+ String get restore_active_seed => "Active seed";
129
String get restore_address => "Address";
130
String get restore_description_from_backup => "You can restore the whole Cake Wallet app from your back-up file";
131
String get restore_description_from_keys => "Restore your wallet from generated keystrokes saved from your private keys";
132
String get restore_description_from_seed => "Restore your wallet from either the 25 word or 13 word combination code";
133
String get restore_description_from_seed_keys => "Get back your wallet from seed/keys that you've saved to secure place";
134
String get restore_from_seed_placeholder => "Please enter or paste your seed here";
135
+ String get restore_new_seed => "New seed";
136
String get restore_next => "Next";
137
String get restore_recover => "Restore";
138
String get restore_restore_wallet => "Restore Wallet";
139
String get restore_seed_keys_restore => "Seed/Keys Restore";
140
String get restore_spend_key_private => "Spend key (private)";
139
- String get restore_title_from_backup => "Restore from a back-up file";
141
+ String get restore_title_from_backup => "Restore from back-up";
142
String get restore_title_from_keys => "Restore from keys";
143
String get restore_title_from_seed => "Restore from seed";
144
String get restore_title_from_seed_keys => "Restore from seed/keys";
@@ -460,6 +462,8 @@ class $de extends S {
462
@override
463
String get transaction_priority_slow => "Schleppend";
464
@override
465
+ String get restore_new_seed => "Neuer Seed";
466
+ @override
467
String get add => "Hinzufügen";
468
@override
469
String get remove_node => "Knoten entfernen";
@@ -670,6 +674,8 @@ class $de extends S {
674
@override
675
String get settings_fee_priority => "Gebührenpriorität";
676
@override
677
+ String get restore_active_seed => "Aktives Seed";
678
+ @override
679
String get settings_personal => "persönlich";
680
@override
681
String get seed_title => "Seed";
@@ -1032,6 +1038,8 @@ class $hi extends S {
1038
@override
1039
String get transaction_priority_slow => "धीरे";
1040
@override
1041
+ String get restore_new_seed => "नया बीज";
1042
+ @override
1043
String get add => "जोड़ना";
1044
@override
1045
String get remove_node => "नोड निकालें";
@@ -1242,6 +1250,8 @@ class $hi extends S {
1250
@override
1251
String get settings_fee_priority => "शुल्क प्राथमिकता";
1252
@override
1253
+ String get restore_active_seed => "सक्रिय बीज";
1254
+ @override
1255
String get settings_personal => "निजी";
1256
@override
1257
String get seed_title => "बीज";
@@ -1604,6 +1614,8 @@ class $ru extends S {
1614
@override
1615
String get transaction_priority_slow => "Медленный";
1616
@override
1617
+ String get restore_new_seed => "Новая мнемоническая фраза";
1618
+ @override
1619
String get add => "Добавить";
1620
@override
1621
String get remove_node => "Удалить ноду";
@@ -1814,6 +1826,8 @@ class $ru extends S {
1826
@override
1827
String get settings_fee_priority => "Приоритет транзакции";
1828
@override
1829
+ String get restore_active_seed => "Активная мнемоническая фраза";
1830
+ @override
1831
String get settings_personal => "Персональные";
1832
@override
1833
String get seed_title => "Мнемоническая фраза";
@@ -2176,6 +2190,8 @@ class $ko extends S {
2190
@override
2191
String get transaction_priority_slow => "느린";
2192
@override
2193
+ String get restore_new_seed => "새로운 씨앗";
2194
+ @override
2195
String get add => "더하다";
2196
@override
2197
String get remove_node => "노드 제거";
@@ -2386,6 +2402,8 @@ class $ko extends S {
2402
@override
2403
String get settings_fee_priority => "수수료 우선";
2404
@override
2405
+ String get restore_active_seed => "활성 종자";
2406
+ @override
2407
String get settings_personal => "개인적인";
2408
@override
2409
String get seed_title => "씨";
@@ -2748,6 +2766,8 @@ class $pt extends S {
2766
@override
2767
String get transaction_priority_slow => "Lenta";
2768
@override
2769
+ String get restore_new_seed => "Nova semente";
2770
+ @override
2771
String get add => "Adicionar";
2772
@override
2773
String get remove_node => "Remover nó";
@@ -2958,6 +2978,8 @@ class $pt extends S {
2978
@override
2979
String get settings_fee_priority => "Prioridade da taxa";
2980
@override
2981
+ String get restore_active_seed => "Semente ativa";
2982
+ @override
2983
String get settings_personal => "Pessoal";
2984
@override
2985
String get seed_title => "Semente";
@@ -3320,6 +3342,8 @@ class $uk extends S {
3342
@override
3343
String get transaction_priority_slow => "Повільний";
3344
@override
3345
+ String get restore_new_seed => "Нова мнемонічна фраза";
3346
+ @override
3347
String get add => "Добавити";
3348
@override
3349
String get remove_node => "Видалити вузол";
@@ -3530,6 +3554,8 @@ class $uk extends S {
3554
@override
3555
String get settings_fee_priority => "Пріоритет транзакції";
3556
@override
3557
+ String get restore_active_seed => "Активна мнемонічна фраза";
3558
+ @override
3559
String get settings_personal => "Персональні";
3560
@override
3561
String get seed_title => "Мнемонічна фраза";
@@ -3892,6 +3918,8 @@ class $ja extends S {
3918
@override
3919
String get transaction_priority_slow => "スロー";
3920
@override
3921
+ String get restore_new_seed => "新しい種";
3922
+ @override
3923
String get add => "加える";
3924
@override
3925
String get remove_node => "ノードを削除";
@@ -4102,6 +4130,8 @@ class $ja extends S {
4130
@override
4131
String get settings_fee_priority => "料金優先";
4132
@override
4133
+ String get restore_active_seed => "アクティブシード";
4134
+ @override
4135
String get settings_personal => "パーソナル";
4136
@override
4137
String get seed_title => "シード";
@@ -4468,6 +4498,8 @@ class $pl extends S {
4498
@override
4499
String get transaction_priority_slow => "Powolny";
4500
@override
4501
+ String get restore_new_seed => "Nowe nasienie";
4502
+ @override
4503
String get add => "Dodaj";
4504
@override
4505
String get remove_node => "Usuń węzeł";
@@ -4678,6 +4710,8 @@ class $pl extends S {
4710
@override
4711
String get settings_fee_priority => "Priorytet opłaty";
4712
@override
4713
+ String get restore_active_seed => "Aktywne nasiona";
4714
+ @override
4715
String get settings_personal => "Osobisty";
4716
@override
4717
String get seed_title => "Ziarno";
@@ -5040,6 +5074,8 @@ class $es extends S {
5074
@override
5075
String get transaction_priority_slow => "Lento";
5076
@override
5077
+ String get restore_new_seed => "Nueva semilla";
5078
+ @override
5079
String get add => "Añadir";
5080
@override
5081
String get remove_node => "Eliminar nodo";
@@ -5250,6 +5286,8 @@ class $es extends S {
5286
@override
5287
String get settings_fee_priority => "Prioridad de tasa";
5288
@override
5289
+ String get restore_active_seed => "Semilla activa";
5290
+ @override
5291
String get settings_personal => "Personal";
5292
@override
5293
String get seed_title => "Semilla";
@@ -5612,6 +5650,8 @@ class $nl extends S {
5650
@override
5651
String get transaction_priority_slow => "Langzaam";
5652
@override
5653
+ String get restore_new_seed => "Nieuw zaad";
5654
+ @override
5655
String get add => "Toevoegen";
5656
@override
5657
String get remove_node => "Knoop verwijderen";
@@ -5822,6 +5862,8 @@ class $nl extends S {
5862
@override
5863
String get settings_fee_priority => "Tariefprioriteit";
5864
@override
5865
+ String get restore_active_seed => "Actief zaad";
5866
+ @override
5867
String get settings_personal => "Persoonlijk";
5868
@override
5869
String get seed_title => "Zaad";
@@ -6184,6 +6226,8 @@ class $zh extends S {
6226
@override
6227
String get transaction_priority_slow => "慢";
6228
@override
6229
+ String get restore_new_seed => "新種子";
6230
+ @override
6231
String get add => "加";
6232
@override
6233
String get remove_node => "删除节点";
@@ -6394,6 +6438,8 @@ class $zh extends S {
6438
@override
6439
String get settings_fee_priority => "费用优先";
6440
@override
6441
+ String get restore_active_seed => "活性種子";
6442
+ @override
6443
String get settings_personal => "个人";
6444
@override
6445
String get seed_title => "种子";
lib/src/screens/accounts/account_page.dart
+1
-4
@@ -98,10 +98,7 @@ class AccountFormState extends State<AccountForm> {
98
.primaryTextTheme
99
.button
100
.backgroundColor,
101
- borderColor: Theme.of(context)
102
- .primaryTextTheme
103
- .button
104
- .decorationColor,
101
+ textColor: Theme.of(context).primaryTextTheme.button.color,
102
isLoading: accountListStore.isAccountCreating,
103
))
104
],
lib/src/screens/exchange/exchange_page.dart
+1
-4
@@ -255,10 +255,7 @@ class ExchangeFormState extends State<ExchangeForm> {
255
.primaryTextTheme
256
.button
257
.backgroundColor,
258
- borderColor: Theme.of(context)
259
- .primaryTextTheme
260
- .button
261
- .decorationColor,
258
+ textColor: Theme.of(context).primaryTextTheme.button.color,
259
isLoading: exchangeStore.tradeState is TradeIsCreating,
260
)),
261
Observer(builder: (_) {
lib/src/screens/exchange_trade/exchange_trade_page.dart
+1
-4
@@ -315,10 +315,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
315
.primaryTextTheme
316
.button
317
.backgroundColor,
318
- borderColor: Theme.of(context)
319
- .primaryTextTheme
320
- .button
321
- .decorationColor),
318
+ textColor: Theme.of(context).primaryTextTheme.button.color),
319
)
320
: Offstage()),
321
);
lib/src/screens/new_wallet/new_wallet_page.dart
+1
-2
@@ -126,8 +126,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
126
},
127
text: S.of(context).continue_text,
128
color: Theme.of(context).primaryTextTheme.button.backgroundColor,
129
- borderColor:
130
- Theme.of(context).primaryTextTheme.button.decorationColor,
129
+ textColor: Theme.of(context).primaryTextTheme.button.color,
130
isLoading: walletCreationStore.state is WalletIsCreating,
131
);
132
},
lib/src/screens/rescan/rescan_page.dart
+1
-2
@@ -33,8 +33,7 @@ class RescanPage extends BasePage {
33
},
34
color:
35
Theme.of(context).primaryTextTheme.button.backgroundColor,
36
- borderColor:
37
- Theme.of(context).primaryTextTheme.button.decorationColor))
36
+ textColor: Theme.of(context).primaryTextTheme.button.color))
37
]),
38
);
39
}
lib/src/screens/restore/restore_wallet_from_keys_page.dart
+121
-73
@@ -16,6 +16,7 @@ import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
16
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
17
import 'package:cake_wallet/palette.dart';
18
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
19
+import 'package:cake_wallet/src/screens/restore/widgets/restore_alert_dialog.dart';
20
21
class RestoreWalletFromKeysPage extends BasePage {
22
RestoreWalletFromKeysPage(
@@ -30,6 +31,9 @@ class RestoreWalletFromKeysPage extends BasePage {
31
@override
32
String get title => S.current.restore_title_from_keys;
33
34
+ @override
35
+ Color get backgroundColor => PaletteDark.historyPanel;
36
+
37
@override
38
Widget body(BuildContext context) => RestoreFromKeysFrom();
39
}
@@ -47,11 +51,36 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
51
final _viewKeyController = TextEditingController();
52
final _spendKeyController = TextEditingController();
53
54
+ @override
55
+ void dispose() {
56
+ _nameController.dispose();
57
+ _addressController.dispose();
58
+ _viewKeyController.dispose();
59
+ _spendKeyController.dispose();
60
+ super.dispose();
61
+ }
62
+
63
+ void onHandleControllers(WalletRestorationStore walletRestorationStore) {
64
+ if (_nameController.text.isNotEmpty &&
65
+ _addressController.text.isNotEmpty &&
66
+ _viewKeyController.text.isNotEmpty &&
67
+ _spendKeyController.text.isNotEmpty) {
68
+ walletRestorationStore.setDisabledState(false);
69
+ } else {
70
+ walletRestorationStore.setDisabledState(true);
71
+ }
72
+ }
73
+
74
@override
75
Widget build(BuildContext context) {
76
final walletRestorationStore = Provider.of<WalletRestorationStore>(context);
77
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
78
79
+ _nameController.addListener(() {onHandleControllers(walletRestorationStore);});
80
+ _addressController.addListener(() {onHandleControllers(walletRestorationStore);});
81
+ _viewKeyController.addListener(() {onHandleControllers(walletRestorationStore);});
82
+ _spendKeyController.addListener(() {onHandleControllers(walletRestorationStore);});
83
+
84
reaction((_) => walletRestorationStore.state, (WalletRestorationState state) {
85
if (state is WalletRestoredSuccessfully) {
86
Navigator.of(context).popUntil((route) => route.isFirst);
@@ -62,48 +91,49 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
91
showDialog<void>(
92
context: context,
93
builder: (BuildContext context) {
65
- return AlertDialog(
66
- content: Text(state.error),
67
- actions: <Widget>[
68
- FlatButton(
69
- child: Text(S.of(context).ok),
70
- onPressed: () => Navigator.of(context).pop(),
71
- ),
72
- ],
94
+ return RestoreAlertDialog(
95
+ restoreTitle: S.current.restore_title_from_keys,
96
+ restoreContent: state.error,
97
+ restoreButtonText: S.of(context).ok,
98
+ restoreButtonAction: () => Navigator.of(context).pop(),
99
);
100
});
101
});
102
}
103
});
104
79
- return ScrollableWithBottomSection(
80
- contentPadding: EdgeInsets.only(left: 20.0, right: 20.0, bottom: 20.0),
81
- content: Form(
82
- key: _formKey,
83
- child: Column(
84
- crossAxisAlignment: CrossAxisAlignment.start,
85
- children: <Widget>[
86
- Padding(
87
- padding: EdgeInsets.only(left: 13, right: 13),
88
- child: Column(children: <Widget>[
89
- Row(
90
- children: <Widget>[
91
- Flexible(
92
- child: Container(
105
+ return Container(
106
+ color: PaletteDark.historyPanel,
107
+ padding: EdgeInsets.only(left: 24, right: 24),
108
+ child: ScrollableWithBottomSection(
109
+ contentPadding: EdgeInsets.only(bottom: 24.0),
110
+ content: Form(
111
+ key: _formKey,
112
+ child: Column(children: <Widget>[
113
+ Row(
114
+ children: <Widget>[
115
+ Flexible(
116
+ child: Container(
117
padding: EdgeInsets.only(top: 20.0),
118
child: TextFormField(
95
- style: TextStyle(fontSize: 14.0),
119
+ style: TextStyle(
120
+ fontSize: 16.0,
121
+ color: Colors.white
122
+ ),
123
controller: _nameController,
124
decoration: InputDecoration(
98
- hintStyle:
99
- TextStyle(color: Theme.of(context).hintColor),
125
+ hintStyle: TextStyle(
126
+ color: PaletteDark.walletCardText,
127
+ fontSize: 16
128
+ ),
129
hintText: S.of(context).restore_wallet_name,
130
focusedBorder: UnderlineInputBorder(
131
borderSide: BorderSide(
103
- color: Palette.cakeGreen, width: 2.0)),
132
+ color: PaletteDark.menuList,
133
+ width: 1.0)),
134
enabledBorder: UnderlineInputBorder(
135
borderSide: BorderSide(
106
- color: Theme.of(context).focusColor,
136
+ color: PaletteDark.menuList,
137
width: 1.0))),
138
validator: (value) {
139
walletRestorationStore.validateWalletName(value);
@@ -111,28 +141,34 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
141
},
142
),
143
))
114
- ],
115
- ),
116
- Row(
117
- children: <Widget>[
118
- Flexible(
119
- child: Container(
144
+ ],
145
+ ),
146
+ Row(
147
+ children: <Widget>[
148
+ Flexible(
149
+ child: Container(
150
padding: EdgeInsets.only(top: 20.0),
151
child: TextFormField(
122
- style: TextStyle(fontSize: 14.0),
152
+ style: TextStyle(
153
+ fontSize: 16.0,
154
+ color: Colors.white
155
+ ),
156
controller: _addressController,
157
keyboardType: TextInputType.multiline,
158
maxLines: null,
159
decoration: InputDecoration(
127
- hintStyle:
128
- TextStyle(color: Theme.of(context).hintColor),
160
+ hintStyle: TextStyle(
161
+ color: PaletteDark.walletCardText,
162
+ fontSize: 16
163
+ ),
164
hintText: S.of(context).restore_address,
165
focusedBorder: UnderlineInputBorder(
166
borderSide: BorderSide(
132
- color: Palette.cakeGreen, width: 2.0)),
167
+ color: PaletteDark.menuList,
168
+ width: 1.0)),
169
enabledBorder: UnderlineInputBorder(
170
borderSide: BorderSide(
135
- color: Theme.of(context).focusColor,
171
+ color: PaletteDark.menuList,
172
width: 1.0))),
173
validator: (value) {
174
walletRestorationStore.validateAddress(value);
@@ -140,26 +176,32 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
176
},
177
),
178
))
143
- ],
144
- ),
145
- Row(
146
- children: <Widget>[
147
- Flexible(
148
- child: Container(
179
+ ],
180
+ ),
181
+ Row(
182
+ children: <Widget>[
183
+ Flexible(
184
+ child: Container(
185
padding: EdgeInsets.only(top: 20.0),
186
child: TextFormField(
151
- style: TextStyle(fontSize: 14.0),
187
+ style: TextStyle(
188
+ fontSize: 16.0,
189
+ color: Colors.white
190
+ ),
191
controller: _viewKeyController,
192
decoration: InputDecoration(
154
- hintStyle:
155
- TextStyle(color: Theme.of(context).hintColor),
193
+ hintStyle: TextStyle(
194
+ color: PaletteDark.walletCardText,
195
+ fontSize: 16
196
+ ),
197
hintText: S.of(context).restore_view_key_private,
198
focusedBorder: UnderlineInputBorder(
199
borderSide: BorderSide(
159
- color: Palette.cakeGreen, width: 2.0)),
200
+ color: PaletteDark.menuList,
201
+ width: 1.0)),
202
enabledBorder: UnderlineInputBorder(
203
borderSide: BorderSide(
162
- color: Theme.of(context).focusColor,
204
+ color: PaletteDark.menuList,
205
width: 1.0))),
206
validator: (value) {
207
walletRestorationStore.validateKeys(value);
@@ -167,26 +209,32 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
209
},
210
),
211
))
170
- ],
171
- ),
172
- Row(
173
- children: <Widget>[
174
- Flexible(
175
- child: Container(
212
+ ],
213
+ ),
214
+ Row(
215
+ children: <Widget>[
216
+ Flexible(
217
+ child: Container(
218
padding: EdgeInsets.only(top: 20.0),
219
child: TextFormField(
178
- style: TextStyle(fontSize: 14.0),
220
+ style: TextStyle(
221
+ fontSize: 16.0,
222
+ color: Colors.white
223
+ ),
224
controller: _spendKeyController,
225
decoration: InputDecoration(
181
- hintStyle:
182
- TextStyle(color: Theme.of(context).hintColor),
226
+ hintStyle: TextStyle(
227
+ color: PaletteDark.walletCardText,
228
+ fontSize: 16
229
+ ),
230
hintText: S.of(context).restore_spend_key_private,
231
focusedBorder: UnderlineInputBorder(
232
borderSide: BorderSide(
186
- color: Palette.cakeGreen, width: 2.0)),
233
+ color: PaletteDark.menuList,
234
+ width: 1.0)),
235
enabledBorder: UnderlineInputBorder(
236
borderSide: BorderSide(
189
- color: Theme.of(context).focusColor,
237
+ color: PaletteDark.menuList,
238
width: 1.0))),
239
validator: (value) {
240
walletRestorationStore.validateKeys(value);
@@ -194,16 +242,14 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
242
},
243
),
244
))
197
- ],
198
- ),
199
- BlockchainHeightWidget(key: _blockchainHeightKey),
200
- ]),
201
- )
202
- ],
245
+ ],
246
+ ),
247
+ BlockchainHeightWidget(key: _blockchainHeightKey),
248
+ ]),
249
),
204
- ),
205
- bottomSection: Observer(builder: (_) {
206
- return LoadingPrimaryButton(
250
+ bottomSectionPadding: EdgeInsets.only(bottom: 24),
251
+ bottomSection: Observer(builder: (_) {
252
+ return LoadingPrimaryButton(
253
onPressed: () {
254
if (_formKey.currentState.validate()) {
255
walletRestorationStore.restoreFromKeys(
@@ -216,10 +262,12 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
262
}
263
},
264
text: S.of(context).restore_recover,
219
- color: Theme.of(context).primaryTextTheme.button.backgroundColor,
220
- borderColor:
221
- Theme.of(context).primaryTextTheme.button.decorationColor);
222
- }),
265
+ color: Colors.green,
266
+ textColor: Colors.white,
267
+ isDisabled: walletRestorationStore.disabledState,
268
+ );
269
+ }),
270
+ ),
271
);
272
}
273
}
lib/src/screens/restore/restore_wallet_from_seed_details.dart
+76
-58
@@ -11,11 +11,15 @@ import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
11
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
12
import 'package:cake_wallet/src/widgets/primary_button.dart';
13
import 'package:cake_wallet/palette.dart';
14
+import 'package:cake_wallet/src/screens/restore/widgets/restore_alert_dialog.dart';
15
16
class RestoreWalletFromSeedDetailsPage extends BasePage {
17
@override
18
String get title => S.current.restore_wallet_restore_description;
19
20
+ @override
21
+ Color get backgroundColor => PaletteDark.historyPanel;
22
+
23
@override
24
Widget body(BuildContext context) => RestoreFromSeedDetailsForm();
25
}
@@ -32,10 +36,24 @@ class _RestoreFromSeedDetailsFormState
36
final _blockchainHeightKey = GlobalKey<BlockchainHeightState>();
37
final _nameController = TextEditingController();
38
39
+ @override
40
+ void dispose() {
41
+ _nameController.dispose();
42
+ super.dispose();
43
+ }
44
+
45
@override
46
Widget build(BuildContext context) {
47
final walletRestorationStore = Provider.of<WalletRestorationStore>(context);
48
49
+ _nameController.addListener(() {
50
+ if (_nameController.text.isNotEmpty) {
51
+ walletRestorationStore.setDisabledState(false);
52
+ } else {
53
+ walletRestorationStore.setDisabledState(true);
54
+ }
55
+ });
56
+
57
reaction((_) => walletRestorationStore.state, (WalletRestorationState state) {
58
if (state is WalletRestoredSuccessfully) {
59
Navigator.of(context).popUntil((route) => route.isFirst);
@@ -46,68 +64,66 @@ class _RestoreFromSeedDetailsFormState
64
showDialog<void>(
65
context: context,
66
builder: (BuildContext context) {
49
- return AlertDialog(
50
- content: Text(state.error),
51
- actions: <Widget>[
52
- FlatButton(
53
- child: Text(S.of(context).ok),
54
- onPressed: () => Navigator.of(context).pop(),
55
- ),
56
- ],
67
+ return RestoreAlertDialog(
68
+ restoreTitle: S.current.restore_wallet_restore_description,
69
+ restoreContent: state.error,
70
+ restoreButtonText: S.of(context).ok,
71
+ restoreButtonAction: () => Navigator.of(context).pop(),
72
);
73
});
74
});
75
}
76
});
77
63
- return ScrollableWithBottomSection(
64
- contentPadding: EdgeInsets.only(left: 20.0, right: 20.0, bottom: 20.0),
65
- content: Form(
66
- key: _formKey,
67
- child: Column(
68
- crossAxisAlignment: CrossAxisAlignment.start,
69
- children: <Widget>[
70
- Padding(
71
- padding: EdgeInsets.only(left: 13, right: 13),
72
- child: Column(
73
- mainAxisAlignment: MainAxisAlignment.center,
74
- children: <Widget>[
75
- Row(
76
- children: <Widget>[
77
- Flexible(
78
- child: Container(
79
- padding: EdgeInsets.only(top: 20.0),
80
- child: TextFormField(
81
- style: TextStyle(fontSize: 14.0),
82
- controller: _nameController,
83
- decoration: InputDecoration(
84
- hintStyle: TextStyle(
85
- color: Theme.of(context).hintColor),
86
- hintText: S.of(context).restore_wallet_name,
87
- focusedBorder: UnderlineInputBorder(
88
- borderSide: BorderSide(
89
- color: Palette.cakeGreen,
90
- width: 2.0)),
91
- enabledBorder: UnderlineInputBorder(
92
- borderSide: BorderSide(
93
- color: Theme.of(context).focusColor,
94
- width: 1.0))),
95
- validator: (value) {
96
- walletRestorationStore
97
- .validateWalletName(value);
98
- return walletRestorationStore.errorMessage;
99
- },
78
+ return Container(
79
+ color: PaletteDark.historyPanel,
80
+ padding: EdgeInsets.only(left: 24, right: 24),
81
+ child: ScrollableWithBottomSection(
82
+ contentPadding: EdgeInsets.only(bottom: 24.0),
83
+ content: Form(
84
+ key: _formKey,
85
+ child: Column(
86
+ children: <Widget>[
87
+ Row(
88
+ children: <Widget>[
89
+ Flexible(
90
+ child: Container(
91
+ padding: EdgeInsets.only(top: 20.0),
92
+ child: TextFormField(
93
+ style: TextStyle(
94
+ fontSize: 16.0,
95
+ color: Colors.white
96
),
101
- ))
102
- ],
103
- ),
104
- BlockchainHeightWidget(key: _blockchainHeightKey),
105
- ]))
106
- ],
97
+ controller: _nameController,
98
+ decoration: InputDecoration(
99
+ hintStyle: TextStyle(
100
+ color: PaletteDark.walletCardText,
101
+ fontSize: 16
102
+ ),
103
+ hintText: S.of(context).restore_wallet_name,
104
+ focusedBorder: UnderlineInputBorder(
105
+ borderSide: BorderSide(
106
+ color: PaletteDark.menuList,
107
+ width: 1.0)),
108
+ enabledBorder: UnderlineInputBorder(
109
+ borderSide: BorderSide(
110
+ color: PaletteDark.menuList,
111
+ width: 1.0))),
112
+ validator: (value) {
113
+ walletRestorationStore
114
+ .validateWalletName(value);
115
+ return walletRestorationStore.errorMessage;
116
+ },
117
+ ),
118
+ ))
119
+ ],
120
+ ),
121
+ BlockchainHeightWidget(key: _blockchainHeightKey),
122
+ ]),
123
),
108
- ),
109
- bottomSection: Observer(builder: (_) {
110
- return LoadingPrimaryButton(
124
+ bottomSectionPadding: EdgeInsets.only(bottom: 24),
125
+ bottomSection: Observer(builder: (_) {
126
+ return LoadingPrimaryButton(
127
onPressed: () {
128
if (_formKey.currentState.validate()) {
129
walletRestorationStore.restoreFromSeed(
@@ -117,10 +133,12 @@ class _RestoreFromSeedDetailsFormState
133
},
134
isLoading: walletRestorationStore.state is WalletIsRestoring,
135
text: S.of(context).restore_recover,
120
- color: Theme.of(context).primaryTextTheme.button.backgroundColor,
121
- borderColor:
122
- Theme.of(context).primaryTextTheme.button.decorationColor);
123
- }),
136
+ color: Colors.green,
137
+ textColor: Colors.white,
138
+ isDisabled: walletRestorationStore.disabledState,
139
+ );
140
+ }),
141
+ ),
142
);
143
}
144
}
lib/src/screens/restore/restore_wallet_from_seed_page.dart
+3
-8
@@ -11,6 +11,7 @@ import 'package:cake_wallet/src/screens/base_page.dart';
11
import 'package:cake_wallet/src/stores/wallet_restoration/wallet_restoration_store.dart';
12
import 'package:cake_wallet/src/widgets/seed_widget.dart';
13
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
14
+import 'package:cake_wallet/palette.dart';
15
16
class RestoreWalletFromSeedPage extends BasePage {
17
RestoreWalletFromSeedPage(
@@ -27,13 +28,7 @@ class RestoreWalletFromSeedPage extends BasePage {
28
String get title => S.current.restore_title_from_seed;
29
30
@override
30
- Widget trailing(BuildContext context) => SizedBox(
31
- width: 80,
32
- height: 20,
33
- child: FlatButton(
34
- child: Text(S.of(context).clear),
35
- padding: EdgeInsets.all(0),
36
- onPressed: () => formKey?.currentState?.clear()));
31
+ Color get backgroundColor => PaletteDark.menuList;
32
33
@override
34
Widget body(BuildContext context) => RestoreFromSeedForm(key: formKey);
@@ -59,7 +54,7 @@ class _RestoreFromSeedFormState extends State<RestoreFromSeedForm> {
54
onTap: () =>
55
SystemChannels.textInput.invokeMethod<void>('TextInput.hide'),
56
child: Container(
62
- padding: EdgeInsets.only(left: 20.0, right: 20.0),
57
+ color: PaletteDark.historyPanel,
58
child: SeedWidget(
59
key: _seedKey,
60
onMnemoticChange: (seed) => walletRestorationStore.setSeed(seed),
lib/src/screens/restore/widgets/restore_alert_dialog.dart
new
+56
@@ -0,0 +1,56 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
3
+
4
+class RestoreAlertDialog extends BaseAlertDialog {
5
+ RestoreAlertDialog({
6
+ @required this.restoreTitle,
7
+ @required this.restoreContent,
8
+ @required this.restoreButtonText,
9
+ @required this.restoreButtonAction,
10
+ });
11
+
12
+ final String restoreTitle;
13
+ final String restoreContent;
14
+ final String restoreButtonText;
15
+ final VoidCallback restoreButtonAction;
16
+
17
+ @override
18
+ String get titleText => restoreTitle;
19
+
20
+ @override
21
+ String get contentText => restoreContent;
22
+
23
+ @override
24
+ Widget actionButtons(BuildContext context) {
25
+ return Container(
26
+ width: 300,
27
+ height: 52,
28
+ padding: EdgeInsets.only(left: 12, right: 12),
29
+ decoration: BoxDecoration(
30
+ borderRadius: BorderRadius.only(
31
+ bottomLeft: Radius.circular(24),
32
+ bottomRight: Radius.circular(24)
33
+ ),
34
+ color: Colors.white
35
+ ),
36
+ child: ButtonTheme(
37
+ minWidth: double.infinity,
38
+ child: FlatButton(
39
+ onPressed: restoreButtonAction,
40
+ highlightColor: Colors.transparent,
41
+ splashColor: Colors.transparent,
42
+ child: Text(
43
+ restoreButtonText,
44
+ textAlign: TextAlign.center,
45
+ style: TextStyle(
46
+ fontSize: 15,
47
+ fontWeight: FontWeight.w600,
48
+ color: Colors.blue,
49
+ decoration: TextDecoration.none,
50
+ ),
51
+ )),
52
+ ),
53
+ );
54
+ }
55
+
56
+}
\ No newline at end of file
lib/src/screens/restore/widgets/restore_button.dart
+2
-2
@@ -20,7 +20,7 @@ class RestoreButton extends StatelessWidget {
20
onTap: onPressed,
21
child: Container(
22
width: double.infinity,
23
- height: 140,
23
+ height: 150,
24
padding: EdgeInsets.all(24),
25
alignment: Alignment.topLeft,
26
decoration: BoxDecoration(
@@ -52,7 +52,7 @@ class RestoreButton extends StatelessWidget {
52
Padding(
53
padding: EdgeInsets.only(top: 5),
54
child: Text(
55
- title,
55
+ description,
56
style: TextStyle(
57
fontSize: 14,
58
color: PaletteDark.walletCardText
lib/src/screens/send/send_page.dart
+1
-2
@@ -436,8 +436,7 @@ class SendFormState extends State<SendForm> {
436
: null,
437
text: S.of(context).send,
438
color: Theme.of(context).accentTextTheme.button.backgroundColor,
439
- borderColor:
440
- Theme.of(context).accentTextTheme.button.decorationColor,
439
+ textColor: Theme.of(context).primaryTextTheme.button.color,
440
isLoading: sendStore.state is CreatingTransaction ||
441
sendStore.state is TransactionCommiting);
442
}));
lib/src/screens/subaddress/new_subaddress_page.dart
+1
-4
@@ -89,10 +89,7 @@ class NewSubaddressFormState extends State<NewSubaddressForm> {
89
.accentTextTheme
90
.button
91
.backgroundColor,
92
- borderColor: Theme.of(context)
93
- .accentTextTheme
94
- .button
95
- .decorationColor,
92
+ textColor: Theme.of(context).primaryTextTheme.button.color,
93
isLoading:
94
subaddressCreationStore.state is SubaddressIsCreating),
95
))
lib/src/stores/wallet_restoration/wallet_restoration_store.dart
+9
@@ -20,6 +20,7 @@ abstract class WalleRestorationStoreBase with Store {
20
@required this.walletListService,
21
@required this.sharedPreferences}) {
22
state = WalletRestorationStateInitial();
23
+ disabledState = true;
24
}
25
26
final AuthenticationStore authStore;
@@ -38,6 +39,9 @@ abstract class WalleRestorationStoreBase with Store {
39
@observable
40
List<MnemoticItem> seed;
41
42
+ @observable
43
+ bool disabledState;
44
+
45
@action
46
Future restoreFromSeed({String name, String seed, int restoreHeight}) async {
47
state = WalletRestorationStateInitial();
@@ -109,6 +113,11 @@ abstract class WalleRestorationStoreBase with Store {
113
return seed.fold('', (acc, item) => acc + ' ' + item.toString());
114
}
115
116
+ @action
117
+ void setDisabledState(bool isDisable) {
118
+ disabledState = isDisable;
119
+ }
120
+
121
void validateWalletName(String value) {
122
const pattern = '^[a-zA-Z0-9_]{1,15}\$';
123
final regExp = RegExp(pattern);
lib/src/widgets/blockchain_height_widget.dart
+24
-11
@@ -37,19 +37,27 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
37
child: Container(
38
padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
39
child: TextFormField(
40
- style: TextStyle(fontSize: 14.0),
40
+ style: TextStyle(
41
+ fontSize: 16.0,
42
+ color: Colors.white
43
+ ),
44
controller: restoreHeightController,
45
keyboardType: TextInputType.numberWithOptions(
46
signed: false, decimal: false),
47
decoration: InputDecoration(
45
- hintStyle: TextStyle(color: Theme.of(context).hintColor),
48
+ hintStyle: TextStyle(
49
+ color: PaletteDark.walletCardText,
50
+ fontSize: 16
51
+ ),
52
hintText: S.of(context).widgets_restore_from_blockheight,
53
focusedBorder: UnderlineInputBorder(
54
borderSide: BorderSide(
49
- color: Palette.cakeGreen, width: 2.0)),
55
+ color: PaletteDark.menuList,
56
+ width: 1.0)),
57
enabledBorder: UnderlineInputBorder(
58
borderSide: BorderSide(
52
- color: Theme.of(context).focusColor, width: 1.0))),
59
+ color: PaletteDark.menuList,
60
+ width: 1.0))),
61
),
62
))
63
],
@@ -61,7 +69,7 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
69
style: TextStyle(
70
fontSize: 16.0,
71
fontWeight: FontWeight.bold,
64
- color: Theme.of(context).primaryTextTheme.title.color),
72
+ color: Colors.white),
73
),
74
),
75
Row(
@@ -72,18 +80,23 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
80
onTap: () => _selectDate(context),
81
child: IgnorePointer(
82
child: TextFormField(
75
- style: TextStyle(fontSize: 14.0),
83
+ style: TextStyle(
84
+ fontSize: 16.0,
85
+ color: Colors.white
86
+ ),
87
decoration: InputDecoration(
77
- hintStyle:
78
- TextStyle(color: Theme.of(context).hintColor),
88
+ hintStyle: TextStyle(
89
+ color: PaletteDark.walletCardText,
90
+ fontSize: 16
91
+ ),
92
hintText: S.of(context).widgets_restore_from_date,
93
focusedBorder: UnderlineInputBorder(
94
borderSide: BorderSide(
82
- color: Palette.cakeGreen,
83
- width: 2.0)),
95
+ color: PaletteDark.menuList,
96
+ width: 1.0)),
97
enabledBorder: UnderlineInputBorder(
98
borderSide: BorderSide(
86
- color: Theme.of(context).focusColor,
99
+ color: PaletteDark.menuList,
100
width: 1.0))),
101
controller: dateController,
102
validator: (value) {
lib/src/widgets/primary_button.dart
+20
-14
@@ -27,15 +27,17 @@ class PrimaryButton extends StatelessWidget {
27
onPressed: isDisabled
28
? (onDisabledPressed != null ? onDisabledPressed : null)
29
: onPressed,
30
- color: isDisabled ? Colors.transparent : color,
30
+ color: isDisabled ? color.withOpacity(0.5) : color,
31
+ disabledColor: color.withOpacity(0.5),
32
shape: RoundedRectangleBorder(
33
borderRadius: BorderRadius.circular(26.0)),
34
child: Text(text,
35
+ textAlign: TextAlign.center,
36
style: TextStyle(
37
fontSize: 15.0,
38
fontWeight: FontWeight.w600,
39
color: isDisabled
38
- ? Palette.darkGrey
40
+ ? Colors.grey.withOpacity(0.5)
41
: textColor)),
42
));
43
}
@@ -44,15 +46,15 @@ class PrimaryButton extends StatelessWidget {
46
class LoadingPrimaryButton extends StatelessWidget {
47
const LoadingPrimaryButton(
48
{@required this.onPressed,
47
- @required this.text,
48
- @required this.color,
49
- @required this.borderColor,
50
- this.isDisabled = false,
51
- this.isLoading = false});
49
+ @required this.text,
50
+ @required this.color,
51
+ @required this.textColor,
52
+ this.isDisabled = false,
53
+ this.isLoading = false});
54
55
final VoidCallback onPressed;
56
final Color color;
55
- final Color borderColor;
57
+ final Color textColor;
58
final bool isLoading;
59
final bool isDisabled;
60
final String text;
@@ -61,19 +63,23 @@ class LoadingPrimaryButton extends StatelessWidget {
63
Widget build(BuildContext context) {
64
return ButtonTheme(
65
minWidth: double.infinity,
64
- height: 56.0,
66
+ height: 52.0,
67
child: FlatButton(
68
onPressed: (isLoading || isDisabled) ? null : onPressed,
69
color: color,
70
+ disabledColor: color.withOpacity(0.5),
71
shape: RoundedRectangleBorder(
69
- side: BorderSide(color: borderColor),
70
- borderRadius: BorderRadius.circular(10.0)),
72
+ borderRadius: BorderRadius.circular(26.0)),
73
child: isLoading
74
? CupertinoActivityIndicator(animating: true)
75
: Text(text,
74
- style: TextStyle(
75
- fontSize: 16.0,
76
- color: Theme.of(context).primaryTextTheme.button.color)),
76
+ style: TextStyle(
77
+ fontSize: 15.0,
78
+ fontWeight: FontWeight.w600,
79
+ color: isDisabled
80
+ ? Colors.grey.withOpacity(0.5)
81
+ : textColor
82
+ )),
83
));
84
}
85
}
lib/src/widgets/seed_widget.dart
+174
-114
@@ -13,6 +13,7 @@ import 'package:cake_wallet/src/domain/monero/mnemonics/russian.dart';
13
import 'package:cake_wallet/src/domain/monero/mnemonics/spanish.dart';
14
import 'package:cake_wallet/src/domain/common/mnemotic_item.dart';
15
import 'package:cake_wallet/generated/i18n.dart';
16
+import 'package:cake_wallet/src/widgets/top_panel.dart';
17
18
class SeedWidget extends StatefulWidget {
19
SeedWidget({Key key, this.onMnemoticChange, this.onFinish, this.seedLanguage}) : super(key: key) {
@@ -235,127 +236,186 @@ class SeedWidgetState extends State<SeedWidget> {
236
child: Column(children: [
237
Flexible(
238
fit: FlexFit.tight,
238
- flex: 6,
239
- child: SingleChildScrollView(
240
- child: Wrap(
241
- children: items.map((item) {
242
- final isValid = item.isCorrect();
243
- final isSelected = selectedItem == item;
244
-
245
- return InkWell(
246
- onTap: () => onMnemoticTap(item),
247
- child: Container(
248
- decoration: BoxDecoration(
249
- color: isValid ? Colors.transparent : Palette.red),
250
- margin: EdgeInsets.only(right: 7, bottom: 8),
251
- child: Text(
252
- item.toString(),
239
+ flex: 1,
240
+ child: TopPanel(
241
+ height: null,
242
+ color: PaletteDark.menuList,
243
+ widget: SingleChildScrollView(
244
+ child: Column(
245
+ mainAxisAlignment: MainAxisAlignment.start,
246
+ crossAxisAlignment: CrossAxisAlignment.start,
247
+ children: <Widget>[
248
+ Text(
249
+ S.of(context).restore_active_seed,
250
style: TextStyle(
254
- color:
255
- isValid ? Palette.blueGrey : Palette.lightGrey,
256
- fontSize: 18,
257
- fontWeight:
258
- isSelected ? FontWeight.w900 : FontWeight.w400,
259
- decoration: isSelected
260
- ? TextDecoration.underline
261
- : TextDecoration.none),
262
- )),
263
- );
264
- }).toList()),
265
- )),
251
+ fontSize: 14,
252
+ color: PaletteDark.walletCardText
253
+ ),
254
+ ),
255
+ Padding(
256
+ padding: EdgeInsets.only(top: 5),
257
+ child: Wrap(
258
+ children: items.map((item) {
259
+ final isValid = item.isCorrect();
260
+ final isSelected = selectedItem == item;
261
+
262
+ return InkWell(
263
+ onTap: () => onMnemoticTap(item),
264
+ child: Container(
265
+ decoration: BoxDecoration(
266
+ color: isValid ? Colors.transparent : Palette.red),
267
+ margin: EdgeInsets.only(right: 7, bottom: 8),
268
+ child: Text(
269
+ item.toString(),
270
+ style: TextStyle(
271
+ color:
272
+ isValid ? Colors.white : Palette.lightGrey,
273
+ fontSize: 16,
274
+ fontWeight:
275
+ isSelected ? FontWeight.w900 : FontWeight.w400,
276
+ decoration: isSelected
277
+ ? TextDecoration.underline
278
+ : TextDecoration.none),
279
+ )),
280
+ );
281
+ }).toList(),)
282
+ )
283
+ ],
284
+ ),
285
+ )
286
+ )
287
+ ),
288
Flexible(
289
fit: FlexFit.tight,
268
- flex: 8,
269
- child: Column(
270
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
290
+ flex: 2,
291
+ child: Padding(
292
+ padding: EdgeInsets.only(left: 24, top: 48, right: 24, bottom: 24),
293
+ child: Column(
294
+ mainAxisAlignment: MainAxisAlignment.start,
295
+ crossAxisAlignment: CrossAxisAlignment.center,
296
children: <Widget>[
272
- Column(children: <Widget>[
273
- TextFormField(
274
- key: _seedTextFieldKey,
275
- onFieldSubmitted: (text) => isCurrentMnemoticValid
276
- ? saveCurrentMnemoticToItems()
277
- : null,
278
- style: TextStyle(fontSize: 14.0),
279
- controller: _seedController,
280
- textInputAction: TextInputAction.done,
281
- decoration: InputDecoration(
282
- suffixIcon: GestureDetector(
283
- behavior: HitTestBehavior.opaque,
284
- child: ConstrainedBox(
285
- constraints: BoxConstraints(maxWidth: 145),
286
- child: Row(
287
- mainAxisAlignment: MainAxisAlignment.end,
288
- children: <Widget>[
289
- Text(
290
- '${items.length}/${SeedWidgetState.maxLength}',
291
- style: TextStyle(
292
- color: Colors.grey, fontSize: 12)),
293
- SizedBox(width: 10),
294
- InkWell(
295
- onTap: () async =>
296
- Clipboard.getData('text/plain').then(
297
- (clipboard) =>
298
- replaceText(clipboard.text)),
299
- child: Container(
300
- height: 35,
301
- padding: EdgeInsets.all(7),
302
- decoration: BoxDecoration(
303
- color:
304
- Palette.wildDarkBlueWithOpacity,
305
- borderRadius:
306
- BorderRadius.circular(10.0)),
307
- child: Text(S.of(context).paste)),
308
- )
309
- ],
310
- ),
297
+ Text(
298
+ S.of(context).restore_new_seed,
299
+ style: TextStyle(
300
+ fontSize: 18,
301
+ fontWeight: FontWeight.bold,
302
+ color: Colors.white
303
+ ),
304
+ ),
305
+ Padding(
306
+ padding: EdgeInsets.only(top: 24),
307
+ child: TextFormField(
308
+ key: _seedTextFieldKey,
309
+ onFieldSubmitted: (text) => isCurrentMnemoticValid
310
+ ? saveCurrentMnemoticToItems()
311
+ : null,
312
+ style: TextStyle(
313
+ fontSize: 16.0,
314
+ color: Colors.white
315
+ ),
316
+ controller: _seedController,
317
+ textInputAction: TextInputAction.done,
318
+ decoration: InputDecoration(
319
+ suffixIcon: GestureDetector(
320
+ behavior: HitTestBehavior.opaque,
321
+ child: ConstrainedBox(
322
+ constraints: BoxConstraints(maxWidth: 145),
323
+ child: Row(
324
+ mainAxisAlignment: MainAxisAlignment.end,
325
+ children: <Widget>[
326
+ Text(
327
+ '${items.length}/${SeedWidgetState.maxLength}',
328
+ style: TextStyle(
329
+ color: PaletteDark.walletCardText,
330
+ fontSize: 14)),
331
+ SizedBox(width: 10),
332
+ InkWell(
333
+ onTap: () async =>
334
+ Clipboard.getData('text/plain').then(
335
+ (clipboard) =>
336
+ replaceText(clipboard.text)),
337
+ child: Container(
338
+ height: 35,
339
+ padding: EdgeInsets.all(7),
340
+ decoration: BoxDecoration(
341
+ color:
342
+ PaletteDark.menuList,
343
+ borderRadius:
344
+ BorderRadius.circular(10.0)),
345
+ child: Text(
346
+ S.of(context).paste,
347
+ style: TextStyle(
348
+ color: Colors.white
349
+ ),
350
+ )),
351
+ )
352
+ ],
353
),
354
),
313
- hintStyle:
314
- TextStyle(color: Theme.of(context).hintColor),
315
- hintText: S.of(context).restore_from_seed_placeholder,
316
- errorText: _errorMessage,
317
- focusedBorder: UnderlineInputBorder(
318
- borderSide: BorderSide(
319
- color: Palette.cakeGreen, width: 2.0)),
320
- enabledBorder: UnderlineInputBorder(
321
- borderSide: BorderSide(
322
- color: Theme.of(context).focusColor,
323
- width: 1.0))),
324
- enableInteractiveSelection: false,
355
+ ),
356
+ hintStyle:
357
+ TextStyle(
358
+ color: PaletteDark.walletCardText,
359
+ fontSize: 16
360
+ ),
361
+ hintText: S.of(context).restore_from_seed_placeholder,
362
+ errorText: _errorMessage,
363
+ focusedBorder: UnderlineInputBorder(
364
+ borderSide: BorderSide(
365
+ color: PaletteDark.menuList, width: 1.0)),
366
+ enabledBorder: UnderlineInputBorder(
367
+ borderSide: BorderSide(
368
+ color: PaletteDark.menuList,
369
+ width: 1.0))),
370
+ enableInteractiveSelection: false,
371
+ ),
372
+ )
373
+ ]),
374
+ )
375
+ ),
376
+ Padding(
377
+ padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
378
+ child: Row(
379
+ children: <Widget>[
380
+ Flexible(
381
+ child: Padding(
382
+ padding: EdgeInsets.only(right: 8),
383
+ child: PrimaryButton(
384
+ onPressed: clear,
385
+ text: S.of(context).clear,
386
+ color: Colors.red,
387
+ textColor: Colors.white,
388
+ isDisabled: items.isEmpty,
389
),
326
- ]),
327
- Padding(
328
- padding: EdgeInsets.only(bottom: 20),
329
- child: (selectedItem == null && items.length == maxLength)
330
- ? PrimaryButton(
331
- text: S.of(context).restore_next,
332
- isDisabled: !isSeedValid(),
333
- onPressed: () => widget.onFinish != null
334
- ? widget.onFinish()
335
- : null,
336
- color: Theme.of(context)
337
- .primaryTextTheme
338
- .button
339
- .backgroundColor,
340
- textColor: Theme.of(context)
341
- .primaryTextTheme
342
- .button
343
- .color)
344
- : PrimaryButton(
345
- text: selectedItem != null
346
- ? S.of(context).save
347
- : S.of(context).add_new_word,
348
- onPressed: () => isCurrentMnemoticValid
349
- ? saveCurrentMnemoticToItems()
350
- : null,
351
- onDisabledPressed: () => showErrorIfExist(),
352
- isDisabled: !isCurrentMnemoticValid,
353
- color: PaletteDark.darkThemeBlueButton,
354
- textColor: Theme.of(context)
355
- .primaryTextTheme
356
- .button
357
- .color))
358
- ]))
390
+ )
391
+ ),
392
+ Flexible(
393
+ child: Padding(
394
+ padding: EdgeInsets.only(left: 8),
395
+ child: (selectedItem == null && items.length == maxLength)
396
+ ? PrimaryButton(
397
+ text: S.of(context).restore_next,
398
+ isDisabled: !isSeedValid(),
399
+ onPressed: () => widget.onFinish != null
400
+ ? widget.onFinish()
401
+ : null,
402
+ color: Colors.green,
403
+ textColor: Colors.white)
404
+ : PrimaryButton(
405
+ text: selectedItem != null
406
+ ? S.of(context).save
407
+ : S.of(context).add_new_word,
408
+ onPressed: () => isCurrentMnemoticValid
409
+ ? saveCurrentMnemoticToItems()
410
+ : null,
411
+ onDisabledPressed: () => showErrorIfExist(),
412
+ isDisabled: !isCurrentMnemoticValid,
413
+ color: Colors.green,
414
+ textColor: Colors.white),
415
+ ),
416
+ )
417
+ ],
418
+ ))
419
]),
420
);
421
}
lib/src/widgets/top_panel.dart
new
+26
@@ -0,0 +1,26 @@
1
+import 'package:flutter/material.dart';
2
+
3
+class TopPanel extends StatelessWidget {
4
+ TopPanel({@required this.height, @required this.color, @required this.widget});
5
+
6
+ final double height;
7
+ final Color color;
8
+ final Widget widget;
9
+
10
+ @override
11
+ Widget build(BuildContext context) {
12
+ return Container(
13
+ width: double.infinity,
14
+ height: height ?? double.infinity,
15
+ padding: EdgeInsets.all(24),
16
+ decoration: BoxDecoration(
17
+ borderRadius: BorderRadius.only(
18
+ bottomLeft: Radius.circular(24),
19
+ bottomRight: Radius.circular(24)
20
+ ),
21
+ color: color
22
+ ),
23
+ child: widget,
24
+ );
25
+ }
26
+}
\ No newline at end of file
res/values/strings_de.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "Schlüssel ausgeben (geheim)",
151
"restore_recover" : "Genesen",
152
"restore_wallet_restore_description" : "Beschreibung zur Wiederherstellung der Brieftasche",
153
+ "restore_new_seed" : "Neuer Seed",
154
+ "restore_active_seed" : "Aktives Seed",
155
156
157
"seed_title" : "Seed",
res/values/strings_en.arb
+3
-1
@@ -137,7 +137,7 @@
137
"restore_title_from_seed_keys" : "Restore from seed/keys",
138
"restore_description_from_seed_keys" : "Get back your wallet from seed/keys that you've saved to secure place",
139
"restore_next" : "Next",
140
- "restore_title_from_backup" : "Restore from a back-up file",
140
+ "restore_title_from_backup" : "Restore from back-up",
141
"restore_description_from_backup" : "You can restore the whole Cake Wallet app from your back-up file",
142
"restore_seed_keys_restore" : "Seed/Keys Restore",
143
"restore_title_from_seed" : "Restore from seed",
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "Spend key (private)",
151
"restore_recover" : "Restore",
152
"restore_wallet_restore_description" : "Wallet restore description",
153
+ "restore_new_seed" : "New seed",
154
+ "restore_active_seed" : "Active seed",
155
156
157
"seed_title" : "Seed",
res/values/strings_es.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "Spend clave (privado)",
151
"restore_recover" : "Recuperar",
152
"restore_wallet_restore_description" : "Restaurar billetera",
153
+ "restore_new_seed" : "Nueva semilla",
154
+ "restore_active_seed" : "Semilla activa",
155
156
157
"seed_title" : "Semilla",
res/values/strings_hi.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "कुंजी खर्च करें (निजीe)",
151
"restore_recover" : "वसूली",
152
"restore_wallet_restore_description" : "बटुआ विवरण पुनर्स्थापित करें",
153
+ "restore_new_seed" : "नया बीज",
154
+ "restore_active_seed" : "सक्रिय बीज",
155
156
157
"seed_title" : "बीज",
res/values/strings_ja.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "キーを使う (プライベート)",
151
"restore_recover" : "回復します",
152
"restore_wallet_restore_description" : "ウォレットの復元",
153
+ "restore_new_seed" : "新しい種",
154
+ "restore_active_seed" : "アクティブシード",
155
156
157
"seed_title" : "シード",
res/values/strings_ko.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "지출 키 (은밀한)",
151
"restore_recover" : "다시 덮다",
152
"restore_wallet_restore_description" : "월렛 복원 설명",
153
+ "restore_new_seed" : "새로운 씨앗",
154
+ "restore_active_seed" : "활성 종자",
155
156
157
"seed_title" : "씨",
res/values/strings_nl.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "Sleutel uitgeven (privaat)",
151
"restore_recover" : "Herstellen",
152
"restore_wallet_restore_description" : "Portemonnee-herstelbeschrijving",
153
+ "restore_new_seed" : "Nieuw zaad",
154
+ "restore_active_seed" : "Actief zaad",
155
156
157
"seed_title" : "Zaad",
res/values/strings_pl.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "Wydaj klucz (prywatny)",
151
"restore_recover" : "Wyzdrowieć",
152
"restore_wallet_restore_description" : "Opis przywracania portfela",
153
+ "restore_new_seed" : "Nowe nasienie",
154
+ "restore_active_seed" : "Aktywne nasiona",
155
156
157
"seed_title" : "Ziarno",
res/values/strings_pt.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "Chave de gastos (privada)",
151
"restore_recover" : "Restaurar",
152
"restore_wallet_restore_description" : "Restauração da carteira",
153
+ "restore_new_seed" : "Nova semente",
154
+ "restore_active_seed" : "Semente ativa",
155
156
157
"seed_title" : "Semente",
res/values/strings_ru.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "Приватный ключ траты",
151
"restore_recover" : "Восстановить",
152
"restore_wallet_restore_description" : "Описание восстановления кошелька",
153
+ "restore_new_seed" : "Новая мнемоническая фраза",
154
+ "restore_active_seed" : "Активная мнемоническая фраза",
155
156
157
"seed_title" : "Мнемоническая фраза",
res/values/strings_uk.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "Приватний ключ витрати",
151
"restore_recover" : "Відновити",
152
"restore_wallet_restore_description" : "Опис відновлюваного гаманця",
153
+ "restore_new_seed" : "Нова мнемонічна фраза",
154
+ "restore_active_seed" : "Активна мнемонічна фраза",
155
156
157
"seed_title" : "Мнемонічна фраза",
res/values/strings_zh.arb
+2
@@ -150,6 +150,8 @@
150
"restore_spend_key_private" : "支出金钥 (私人的)",
151
"restore_recover" : "恢复",
152
"restore_wallet_restore_description" : "钱包还原说明",
153
+ "restore_new_seed" : "新種子",
154
+ "restore_active_seed" : "活性種子",
155
156
157
"seed_title" : "种子",