CWA-209 | applied new design to account_list_page, account_page and new_subaddress_page; moved header tile from receive_page to a single file; created account tile and base text form field
Oleksandr Sobol committed
May 6, 2020 at 20:40 UTC
e1de337ab1373289c80cfc29067e09d8f5828e09
25 files changed
+678
-362
lib/generated/i18n.dart
+93
-1
@@ -23,6 +23,7 @@ class S implements WidgetsLocalizations {
23
24
String get account => "Account";
25
String get accounts => "Accounts";
26
+ String get accounts_subaddresses => "Accounts and subaddresses";
27
String get add => "Add";
28
String get add_new_word => "Add new word";
29
String get address_book => "Address Book";
@@ -47,6 +48,7 @@ class S implements WidgetsLocalizations {
48
String get change_currency => "Change Currency";
49
String get change_exchange_provider => "Change Exchange Provider";
50
String get change_language => "Change language";
51
+ String get choose_account => "Choose account";
52
String get choose_wallet_currency => "Please choose wallet currency:";
53
String get clear => "Clear";
54
String get confirm => "Confirm";
@@ -59,6 +61,7 @@ class S implements WidgetsLocalizations {
61
String get copy_address => "Copy Address";
62
String get copy_id => "Copy ID";
63
String get create_new => "Create New Wallet";
64
+ String get create_new_account => "Create new account";
65
String get delete => "Delete";
66
String get digit_pin => "-digit PIN";
67
String get edit => "Edit";
@@ -125,6 +128,7 @@ class S implements WidgetsLocalizations {
128
String get remove => "Remove";
129
String get remove_node => "Remove node";
130
String get remove_node_message => "Are you sure that you want to remove selected node?";
131
+ String get rename => "Rename";
132
String get rescan => "Rescan";
133
String get reset => "Reset";
134
String get restore_active_seed => "Active seed";
@@ -447,6 +451,8 @@ class $de extends S {
451
@override
452
String get trade_details_fetching => "Holen";
453
@override
454
+ String get create_new_account => "Neues Konto erstellen";
455
+ @override
456
String get buy => "Kaufen";
457
@override
458
String get confirm_sending => "Bestätigen Sie das Senden";
@@ -595,6 +601,8 @@ class $de extends S {
601
@override
602
String get change_language => "Sprache ändern";
603
@override
604
+ String get accounts_subaddresses => "Konten und Unteradressen";
605
+ @override
606
String get wallet_name => "Walletname";
607
@override
608
String get error_text_payment_id => "Die Zahlungs-ID kann nur 16 bis 64 hexadezimale Zeichen enthalten";
@@ -683,6 +691,8 @@ class $de extends S {
691
@override
692
String get settings_fee_priority => "Gebührenpriorität";
693
@override
694
+ String get rename => "Umbenennen";
695
+ @override
696
String get restore_active_seed => "Aktives Seed";
697
@override
698
String get settings_personal => "persönlich";
@@ -709,6 +719,8 @@ class $de extends S {
719
@override
720
String get spend_key_private => "Schlüssel ausgeben (geheim)";
721
@override
722
+ String get choose_account => "Konto auswählen";
723
+ @override
724
String get settings_only_trades => "Nur Trades";
725
@override
726
String get trade_state_to_be_created => "Geschaffen werden";
@@ -1029,6 +1041,8 @@ class $hi extends S {
1041
@override
1042
String get trade_details_fetching => "ला रहा है";
1043
@override
1044
+ String get create_new_account => "नया खाता बनाएँ";
1045
+ @override
1046
String get buy => "खरीदें";
1047
@override
1048
String get confirm_sending => "भेजने की पुष्टि करें";
@@ -1177,6 +1191,8 @@ class $hi extends S {
1191
@override
1192
String get change_language => "भाषा बदलो";
1193
@override
1194
+ String get accounts_subaddresses => "लेखा और उपदेस";
1195
+ @override
1196
String get wallet_name => "बटुए का नाम";
1197
@override
1198
String get error_text_payment_id => "पेमेंट आईडी केवल हेक्स में 16 से 64 चार्ट तक हो सकती है";
@@ -1265,6 +1281,8 @@ class $hi extends S {
1281
@override
1282
String get settings_fee_priority => "शुल्क प्राथमिकता";
1283
@override
1284
+ String get rename => "नाम बदलें";
1285
+ @override
1286
String get restore_active_seed => "सक्रिय बीज";
1287
@override
1288
String get settings_personal => "निजी";
@@ -1291,6 +1309,8 @@ class $hi extends S {
1309
@override
1310
String get spend_key_private => "खर्च करना (निजी)";
1311
@override
1312
+ String get choose_account => "खाता चुनें";
1313
+ @override
1314
String get settings_only_trades => "केवल ट्रेड करता है";
1315
@override
1316
String get trade_state_to_be_created => "बनाए जाने के लिए";
@@ -1611,6 +1631,8 @@ class $ru extends S {
1631
@override
1632
String get trade_details_fetching => "Получение";
1633
@override
1634
+ String get create_new_account => "Создать новый аккаунт";
1635
+ @override
1636
String get buy => "Купить";
1637
@override
1638
String get confirm_sending => "Подтвердить отправку";
@@ -1759,6 +1781,8 @@ class $ru extends S {
1781
@override
1782
String get change_language => "Изменить язык";
1783
@override
1784
+ String get accounts_subaddresses => "Аккаунты и субадреса";
1785
+ @override
1786
String get wallet_name => "Имя кошелька";
1787
@override
1788
String get error_text_payment_id => "Идентификатор платежа может содержать от 16 до 64 символов в hex";
@@ -1847,6 +1871,8 @@ class $ru extends S {
1871
@override
1872
String get settings_fee_priority => "Приоритет транзакции";
1873
@override
1874
+ String get rename => "Переименовать";
1875
+ @override
1876
String get restore_active_seed => "Активная мнемоническая фраза";
1877
@override
1878
String get settings_personal => "Персональные";
@@ -1873,6 +1899,8 @@ class $ru extends S {
1899
@override
1900
String get spend_key_private => "Приватный ключ траты";
1901
@override
1902
+ String get choose_account => "Выберите аккаунт";
1903
+ @override
1904
String get settings_only_trades => "Сделки";
1905
@override
1906
String get trade_state_to_be_created => "Будет создана";
@@ -2193,6 +2221,8 @@ class $ko extends S {
2221
@override
2222
String get trade_details_fetching => "가져 오는 중";
2223
@override
2224
+ String get create_new_account => "새 계정을 만들";
2225
+ @override
2226
String get buy => "구입";
2227
@override
2228
String get confirm_sending => "전송 확인";
@@ -2341,6 +2371,8 @@ class $ko extends S {
2371
@override
2372
String get change_language => "언어 변경";
2373
@override
2374
+ String get accounts_subaddresses => "계정 및 하위 주소";
2375
+ @override
2376
String get wallet_name => "지갑 이름";
2377
@override
2378
String get error_text_payment_id => "지불 ID는 16 ~ 64 자의 16 진 문자 만 포함 할 수 있습니다";
@@ -2429,6 +2461,8 @@ class $ko extends S {
2461
@override
2462
String get settings_fee_priority => "수수료 우선";
2463
@override
2464
+ String get rename => "이름 바꾸기";
2465
+ @override
2466
String get restore_active_seed => "활성 종자";
2467
@override
2468
String get settings_personal => "개인적인";
@@ -2455,6 +2489,8 @@ class $ko extends S {
2489
@override
2490
String get spend_key_private => "지출 키 (은밀한)";
2491
@override
2492
+ String get choose_account => "계정을 선택하십시오";
2493
+ @override
2494
String get settings_only_trades => "거래 만";
2495
@override
2496
String get trade_state_to_be_created => "만들려면";
@@ -2775,6 +2811,8 @@ class $pt extends S {
2811
@override
2812
String get trade_details_fetching => "Buscando";
2813
@override
2814
+ String get create_new_account => "Criar nova conta";
2815
+ @override
2816
String get buy => "Comprar";
2817
@override
2818
String get confirm_sending => "Confirmar o envio";
@@ -2923,6 +2961,8 @@ class $pt extends S {
2961
@override
2962
String get change_language => "Mudar idioma";
2963
@override
2964
+ String get accounts_subaddresses => "Contas e sub-endereços";
2965
+ @override
2966
String get wallet_name => "Nome da carteira";
2967
@override
2968
String get error_text_payment_id => "O ID de pagamento pode conter apenas de 16 a 64 caracteres em hexadecimal";
@@ -3011,6 +3051,8 @@ class $pt extends S {
3051
@override
3052
String get settings_fee_priority => "Prioridade da taxa";
3053
@override
3054
+ String get rename => "Renomear";
3055
+ @override
3056
String get restore_active_seed => "Semente ativa";
3057
@override
3058
String get settings_personal => "Pessoal";
@@ -3037,6 +3079,8 @@ class $pt extends S {
3079
@override
3080
String get spend_key_private => "Chave de gastos (privada)";
3081
@override
3082
+ String get choose_account => "Escolha uma conta";
3083
+ @override
3084
String get settings_only_trades => "Somente trocas";
3085
@override
3086
String get trade_state_to_be_created => "A ser criada";
@@ -3287,7 +3331,7 @@ class $uk extends S {
3331
@override
3332
String get transaction_details_recipient_address => "Адреса отримувача";
3333
@override
3290
- String get receive_amount => "Баланс";
3334
+ String get receive_amount => "Сума";
3335
@override
3336
String get settings_allow_biometrical_authentication => "Включити біометричну аутентифікацію";
3337
@override
@@ -3357,6 +3401,8 @@ class $uk extends S {
3401
@override
3402
String get trade_details_fetching => "Отримання";
3403
@override
3404
+ String get create_new_account => "Створити новий акаунт";
3405
+ @override
3406
String get buy => "Купити";
3407
@override
3408
String get confirm_sending => "Підтвердити відправлення";
@@ -3505,6 +3551,8 @@ class $uk extends S {
3551
@override
3552
String get change_language => "Змінити мову";
3553
@override
3554
+ String get accounts_subaddresses => "Акаунти та субадреси";
3555
+ @override
3556
String get wallet_name => "Ім'я гаманця";
3557
@override
3558
String get error_text_payment_id => "Ідентифікатор платежу може містити від 16 до 64 символів в hex";
@@ -3593,6 +3641,8 @@ class $uk extends S {
3641
@override
3642
String get settings_fee_priority => "Пріоритет транзакції";
3643
@override
3644
+ String get rename => "Перейменувати";
3645
+ @override
3646
String get restore_active_seed => "Активна мнемонічна фраза";
3647
@override
3648
String get settings_personal => "Персональні";
@@ -3619,6 +3669,8 @@ class $uk extends S {
3669
@override
3670
String get spend_key_private => "Приватний ключ витрати";
3671
@override
3672
+ String get choose_account => "Оберіть акаунт";
3673
+ @override
3674
String get settings_only_trades => "Операції";
3675
@override
3676
String get trade_state_to_be_created => "Буде створена";
@@ -3939,6 +3991,8 @@ class $ja extends S {
3991
@override
3992
String get trade_details_fetching => "フェッチング";
3993
@override
3994
+ String get create_new_account => "新しいアカウントを作成する";
3995
+ @override
3996
String get buy => "購入";
3997
@override
3998
String get confirm_sending => "送信を確認";
@@ -4087,6 +4141,8 @@ class $ja extends S {
4141
@override
4142
String get change_language => "言語を変えてください";
4143
@override
4144
+ String get accounts_subaddresses => "アカウントとサブアドレス";
4145
+ @override
4146
String get wallet_name => "ウォレット名";
4147
@override
4148
String get error_text_payment_id => "支払いIDには、16進数で16〜64文字しか含めることができません";
@@ -4175,6 +4231,8 @@ class $ja extends S {
4231
@override
4232
String get settings_fee_priority => "料金優先";
4233
@override
4234
+ String get rename => "リネーム";
4235
+ @override
4236
String get restore_active_seed => "アクティブシード";
4237
@override
4238
String get settings_personal => "パーソナル";
@@ -4201,6 +4259,8 @@ class $ja extends S {
4259
@override
4260
String get spend_key_private => "キーを使う (プライベート)";
4261
@override
4262
+ String get choose_account => "アカウントを選択";
4263
+ @override
4264
String get settings_only_trades => "取引のみ";
4265
@override
4266
String get trade_state_to_be_created => "作成される";
@@ -4525,6 +4585,8 @@ class $pl extends S {
4585
@override
4586
String get trade_details_fetching => "Ujmujący";
4587
@override
4588
+ String get create_new_account => "Stwórz nowe konto";
4589
+ @override
4590
String get buy => "Kup";
4591
@override
4592
String get confirm_sending => "Potwierdź wysłanie";
@@ -4673,6 +4735,8 @@ class $pl extends S {
4735
@override
4736
String get change_language => "Zmień język";
4737
@override
4738
+ String get accounts_subaddresses => "Konta i podadresy";
4739
+ @override
4740
String get wallet_name => "Nazwa portfela";
4741
@override
4742
String get error_text_payment_id => "ID może zawierać od 16 do 64 znaków w formacie szesnastkowym";
@@ -4761,6 +4825,8 @@ class $pl extends S {
4825
@override
4826
String get settings_fee_priority => "Priorytet opłaty";
4827
@override
4828
+ String get rename => "Przemianować";
4829
+ @override
4830
String get restore_active_seed => "Aktywne nasiona";
4831
@override
4832
String get settings_personal => "Osobisty";
@@ -4787,6 +4853,8 @@ class $pl extends S {
4853
@override
4854
String get spend_key_private => "Wydaj klucz (prywatny)";
4855
@override
4856
+ String get choose_account => "Wybierz konto";
4857
+ @override
4858
String get settings_only_trades => "Tylko transakcje";
4859
@override
4860
String get trade_state_to_be_created => "Zostać stworzonym";
@@ -5107,6 +5175,8 @@ class $es extends S {
5175
@override
5176
String get trade_details_fetching => "Cargando";
5177
@override
5178
+ String get create_new_account => "Crear una nueva cuenta";
5179
+ @override
5180
String get buy => "Comprar";
5181
@override
5182
String get confirm_sending => "Confirmar envío";
@@ -5255,6 +5325,8 @@ class $es extends S {
5325
@override
5326
String get change_language => "Cambiar idioma";
5327
@override
5328
+ String get accounts_subaddresses => "Cuentas y subdirecciones";
5329
+ @override
5330
String get wallet_name => "Nombre de la billetera";
5331
@override
5332
String get error_text_payment_id => "La ID de pago solo puede contener de 16 a 64 caracteres en hexadecimal";
@@ -5343,6 +5415,8 @@ class $es extends S {
5415
@override
5416
String get settings_fee_priority => "Prioridad de tasa";
5417
@override
5418
+ String get rename => "Rebautizar";
5419
+ @override
5420
String get restore_active_seed => "Semilla activa";
5421
@override
5422
String get settings_personal => "Personal";
@@ -5369,6 +5443,8 @@ class $es extends S {
5443
@override
5444
String get spend_key_private => "Spend clave (privado)";
5445
@override
5446
+ String get choose_account => "Elegir cuenta";
5447
+ @override
5448
String get settings_only_trades => "Solo comercia";
5449
@override
5450
String get trade_state_to_be_created => "Ser creado";
@@ -5689,6 +5765,8 @@ class $nl extends S {
5765
@override
5766
String get trade_details_fetching => "Ophalen";
5767
@override
5768
+ String get create_new_account => "Creëer een nieuw account";
5769
+ @override
5770
String get buy => "Kopen";
5771
@override
5772
String get confirm_sending => "Bevestig verzending";
@@ -5837,6 +5915,8 @@ class $nl extends S {
5915
@override
5916
String get change_language => "Verander de taal";
5917
@override
5918
+ String get accounts_subaddresses => "Accounts en subadressen";
5919
+ @override
5920
String get wallet_name => "Portemonnee naam";
5921
@override
5922
String get error_text_payment_id => "Betalings-ID kan alleen 16 tot 64 tekens bevatten in hexadecimale volgorde";
@@ -5925,6 +6005,8 @@ class $nl extends S {
6005
@override
6006
String get settings_fee_priority => "Tariefprioriteit";
6007
@override
6008
+ String get rename => "Hernoemen";
6009
+ @override
6010
String get restore_active_seed => "Actief zaad";
6011
@override
6012
String get settings_personal => "Persoonlijk";
@@ -5951,6 +6033,8 @@ class $nl extends S {
6033
@override
6034
String get spend_key_private => "Sleutel uitgeven (privaat)";
6035
@override
6036
+ String get choose_account => "Kies account";
6037
+ @override
6038
String get settings_only_trades => "Alleen handel";
6039
@override
6040
String get trade_state_to_be_created => "Om gecreëerd te worden";
@@ -6271,6 +6355,8 @@ class $zh extends S {
6355
@override
6356
String get trade_details_fetching => "正在取得";
6357
@override
6358
+ String get create_new_account => "建立新帳戶";
6359
+ @override
6360
String get buy => "購買";
6361
@override
6362
String get confirm_sending => "确认发送";
@@ -6419,6 +6505,8 @@ class $zh extends S {
6505
@override
6506
String get change_language => "改變語言";
6507
@override
6508
+ String get accounts_subaddresses => "帳戶和子地址";
6509
+ @override
6510
String get wallet_name => "钱包名称";
6511
@override
6512
String get error_text_payment_id => "付款ID只能包含16到64个字符(十六进制)";
@@ -6507,6 +6595,8 @@ class $zh extends S {
6595
@override
6596
String get settings_fee_priority => "费用优先";
6597
@override
6598
+ String get rename => "改名";
6599
+ @override
6600
String get restore_active_seed => "活性種子";
6601
@override
6602
String get settings_personal => "个人";
@@ -6533,6 +6623,8 @@ class $zh extends S {
6623
@override
6624
String get spend_key_private => "支出金钥 (私人的)";
6625
@override
6626
+ String get choose_account => "選擇帳號";
6627
+ @override
6628
String get settings_only_trades => "只交易";
6629
@override
6630
String get trade_state_to_be_created => "待创建";
lib/router.dart
+4
-13
@@ -68,7 +68,6 @@ import 'package:cake_wallet/src/screens/disclaimer/disclaimer_page.dart';
68
import 'package:cake_wallet/src/screens/seed_language/seed_language_page.dart';
69
import 'package:cake_wallet/src/screens/transaction_details/transaction_details_page.dart';
70
import 'package:cake_wallet/src/screens/accounts/account_page.dart';
71
-import 'package:cake_wallet/src/screens/accounts/account_list_page.dart';
71
import 'package:cake_wallet/src/screens/address_book/address_book_page.dart';
72
import 'package:cake_wallet/src/screens/address_book/contact_page.dart';
73
import 'package:cake_wallet/src/screens/show_keys/show_keys_page.dart';
@@ -242,7 +241,10 @@ class Router {
241
builder: (_) => MultiProvider(providers: [
242
Provider(
243
create: (_) =>
245
- SubaddressListStore(walletService: walletService))
244
+ SubaddressListStore(walletService: walletService)),
245
+ Provider(
246
+ create: (_) =>
247
+ AccountListStore(walletService: walletService))
248
], child: ReceivePage()));
249
250
case Routes.transactionDetails:
@@ -325,17 +327,6 @@ class Router {
327
authenticationStore: authenticationStore);
328
});
329
328
- case Routes.accountList:
329
- return MaterialPageRoute<void>(
330
- builder: (context) {
331
- return MultiProvider(providers: [
332
- Provider(
333
- create: (_) =>
334
- AccountListStore(walletService: walletService)),
335
- ], child: AccountListPage());
336
- },
337
- fullscreenDialog: true);
338
-
330
case Routes.accountCreation:
331
return CupertinoPageRoute<String>(builder: (context) {
332
return Provider(
lib/routes.dart
-1
@@ -25,7 +25,6 @@ class Routes {
25
static const newNode = '/new_node_list';
26
static const login = '/login';
27
static const splash = '/splash';
28
- static const accountList = '/account_list';
28
static const accountCreation = '/account_new';
29
static const addressBook = '/address_book';
30
static const pickerAddressBook = '/picker_address_book';
lib/src/screens/accounts/account_list_page.dart
+127
-94
@@ -1,120 +1,153 @@
1
+import 'dart:ui';
2
import 'package:provider/provider.dart';
3
import 'package:flutter/material.dart';
4
import 'package:flutter/cupertino.dart';
5
import 'package:flutter_mobx/flutter_mobx.dart';
5
-import 'package:flutter_slidable/flutter_slidable.dart';
6
import 'package:cake_wallet/palette.dart';
7
import 'package:cake_wallet/routes.dart';
8
import 'package:cake_wallet/generated/i18n.dart';
9
import 'package:cake_wallet/src/stores/account_list/account_list_store.dart';
10
+import 'package:cake_wallet/src/screens/accounts/widgets/account_tile.dart';
11
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
11
-import 'package:cake_wallet/src/screens/base_page.dart';
12
13
-class AccountListPage extends BasePage {
14
- @override
15
- String get title => S.current.accounts;
13
+class AccountListPage extends StatefulWidget {
14
+ AccountListPage({@required this.accountListStore});
15
+
16
+ final AccountListStore accountListStore;
17
18
@override
18
- Widget trailing(BuildContext context) {
19
- final accountListStore = Provider.of<AccountListStore>(context);
19
+ AccountListPageForm createState() => AccountListPageForm(accountListStore);
20
+}
21
21
- return Container(
22
- width: 28.0,
23
- height: 28.0,
24
- decoration: BoxDecoration(
25
- shape: BoxShape.circle, color: Theme.of(context).selectedRowColor),
26
- child: Stack(
27
- alignment: Alignment.center,
28
- children: <Widget>[
29
- Icon(Icons.add, color: Palette.violet, size: 22.0),
30
- ButtonTheme(
31
- minWidth: 28.0,
32
- height: 28.0,
33
- child: FlatButton(
34
- shape: CircleBorder(),
35
- onPressed: () async {
36
- await Navigator.of(context)
37
- .pushNamed(Routes.accountCreation);
38
- accountListStore.updateAccountList();
39
- },
40
- child: Offstage()),
41
- )
42
- ],
43
- ));
44
- }
22
+class AccountListPageForm extends State<AccountListPage> {
23
+ AccountListPageForm(this.accountListStore);
24
+
25
+ final AccountListStore accountListStore;
26
27
@override
47
- Widget body(BuildContext context) {
48
- final accountListStore = Provider.of<AccountListStore>(context);
28
+ Widget build(BuildContext context) {
29
final walletStore = Provider.of<WalletStore>(context);
30
51
- final currentColor = Theme.of(context).selectedRowColor;
52
- final notCurrentColor = Theme.of(context).backgroundColor;
31
+ return GestureDetector(
32
+ onTap: () => Navigator.of(context).pop(),
33
+ child: Container(
34
+ color: Colors.transparent,
35
+ child: BackdropFilter(
36
+ filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
37
+ child: Container(
38
+ decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)),
39
+ child: Center(
40
+ child: Column(
41
+ mainAxisSize: MainAxisSize.min,
42
+ children: <Widget>[
43
+ Container(
44
+ padding: EdgeInsets.only(left: 24, right: 24),
45
+ child: Text(
46
+ S.of(context).choose_account,
47
+ textAlign: TextAlign.center,
48
+ style: TextStyle(
49
+ fontSize: 18,
50
+ fontWeight: FontWeight.bold,
51
+ decoration: TextDecoration.none,
52
+ color: Colors.white
53
+ ),
54
+ ),
55
+ ),
56
+ Padding(
57
+ padding: EdgeInsets.only(left: 24, right: 24, top: 24),
58
+ child: GestureDetector(
59
+ onTap: () => null,
60
+ child: ClipRRect(
61
+ borderRadius: BorderRadius.all(Radius.circular(14)),
62
+ child: Container(
63
+ height: 296,
64
+ color: PaletteDark.menuList,
65
+ child: Column(
66
+ children: <Widget>[
67
+ Expanded(
68
+ child: Observer(
69
+ builder: (_) {
70
+ final accounts = accountListStore.accounts;
71
54
- return Container(
55
- padding: EdgeInsets.only(top: 10, bottom: 20),
56
- child: Observer(builder: (_) {
57
- final accounts = accountListStore.accounts;
58
- return ListView.builder(
59
- itemCount: accounts == null ? 0 : accounts.length,
60
- itemBuilder: (BuildContext context, int index) {
61
- final account = accounts[index];
72
+ return ListView.separated(
73
+ separatorBuilder: (context, index) => Divider(
74
+ color: PaletteDark.mainBackgroundColor,
75
+ height: 1,
76
+ ),
77
+ itemCount: accounts == null ? 0 : accounts.length,
78
+ itemBuilder: (context, index) {
79
+ final account = accounts[index];
80
63
- return Observer(builder: (_) {
64
- final isCurrent = walletStore.account.id == account.id;
81
+ return Observer(
82
+ builder: (_) {
83
+ final isCurrent = walletStore.account.id == account.id;
84
66
- return Slidable(
67
- key: Key(account.id.toString()),
68
- actionPane: SlidableDrawerActionPane(),
69
- child: Container(
70
- color: isCurrent ? currentColor : notCurrentColor,
71
- child: Column(
72
- children: <Widget>[
73
- ListTile(
74
- title: Text(
75
- account.label,
76
- style: TextStyle(
77
- fontSize: 16.0,
78
- color: Theme.of(context)
79
- .primaryTextTheme
80
- .headline
81
- .color),
82
- ),
83
- onTap: () {
84
- if (isCurrent) {
85
- return;
86
- }
85
+ return AccountTile(
86
+ isCurrent: isCurrent,
87
+ accountName: account.label,
88
+ onTap: () {
89
+ if (isCurrent) {
90
+ return;
91
+ }
92
88
- walletStore.setAccount(account);
89
- Navigator.of(context).pop();
90
- },
93
+ walletStore.setAccount(account);
94
+ Navigator.of(context).pop();
95
+ }
96
+ );
97
+ }
98
+ );
99
+ },
100
+ );
101
+ }
102
+ )
103
+ ),
104
+ GestureDetector(
105
+ onTap: () async {
106
+ await Navigator.of(context)
107
+ .pushNamed(Routes.accountCreation);
108
+ accountListStore.updateAccountList();
109
+ },
110
+ child: Container(
111
+ height: 62,
112
+ color: Colors.white,
113
+ padding: EdgeInsets.only(left: 24, right: 24),
114
+ child: Center(
115
+ child: Row(
116
+ mainAxisSize: MainAxisSize.min,
117
+ children: <Widget>[
118
+ Icon(
119
+ Icons.add,
120
+ color: PaletteDark.historyPanel,
121
+ ),
122
+ Padding(
123
+ padding: EdgeInsets.only(left: 5),
124
+ child: Text(
125
+ S.of(context).create_new_account,
126
+ style: TextStyle(
127
+ fontSize: 15,
128
+ fontWeight: FontWeight.w600,
129
+ color: PaletteDark.historyPanel,
130
+ decoration: TextDecoration.none,
131
+ ),
132
+ ),
133
+ )
134
+ ],
135
+ ),
136
+ ),
137
+ ),
138
+ )
139
+ ],
140
+ ),
141
),
92
- Divider(
93
- color: Theme.of(context).dividerTheme.color,
94
- height: 1.0,
95
- )
96
- ],
142
+ ),
143
),
98
- ),
99
- secondaryActions: <Widget>[
100
- IconSlideAction(
101
- caption: S.of(context).edit,
102
- color: Colors.blue,
103
- icon: Icons.edit,
104
- onTap: () async {
105
- await Navigator.of(context).pushNamed(
106
- Routes.accountCreation,
107
- arguments: account);
108
- // await accountListStore.updateAccountList().then((_) {
109
- // if (isCurrent) walletStore.setAccount(accountListStore.accounts[index]);
110
- // });
111
- },
112
- )
113
- ],
114
- );
115
- });
116
- });
117
- }),
144
+ )
145
+ ],
146
+ ),
147
+ ),
148
+ ),
149
+ ),
150
+ ),
151
);
152
}
153
}
lib/src/screens/accounts/account_page.dart
+26
-23
@@ -8,6 +8,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
8
import 'package:cake_wallet/src/screens/base_page.dart';
9
import 'package:cake_wallet/src/domain/monero/account.dart';
10
import 'package:cake_wallet/palette.dart';
11
+import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
12
13
class AccountPage extends BasePage {
14
AccountPage({this.account});
@@ -15,7 +16,10 @@ class AccountPage extends BasePage {
16
final Account account;
17
18
@override
18
- String get title => 'Account';
19
+ String get title => S.current.account;
20
+
21
+ @override
22
+ Color get backgroundColor => PaletteDark.historyPanel;
23
24
@override
25
Widget body(BuildContext context) => AccountForm(account);
@@ -50,30 +54,31 @@ class AccountFormState extends State<AccountForm> {
54
Widget build(BuildContext context) {
55
final accountListStore = Provider.of<AccountListStore>(context);
56
57
+ _textController.addListener(() {
58
+ if (_textController.text.isNotEmpty) {
59
+ accountListStore.setDisabledStatus(false);
60
+ } else {
61
+ accountListStore.setDisabledStatus(true);
62
+ }
63
+ });
64
+
65
return Form(
66
key: _formKey,
67
child: Container(
56
- padding: EdgeInsets.all(20.0),
68
+ color: PaletteDark.historyPanel,
69
+ padding: EdgeInsets.all(24.0),
70
child: Column(
71
children: <Widget>[
72
Expanded(
73
child: Center(
61
- child: TextFormField(
62
- decoration: InputDecoration(
63
- hintStyle: TextStyle(color: Theme.of(context).hintColor),
74
+ child: BaseTextFormField(
75
+ controller: _textController,
76
hintText: S.of(context).account,
65
- focusedBorder: UnderlineInputBorder(
66
- borderSide:
67
- BorderSide(color: Palette.cakeGreen, width: 2.0)),
68
- enabledBorder: UnderlineInputBorder(
69
- borderSide: BorderSide(
70
- color: Theme.of(context).focusColor, width: 1.0))),
71
- controller: _textController,
72
- validator: (value) {
73
- accountListStore.validateAccountName(value);
74
- return accountListStore.errorMessage;
75
- },
76
- ),
77
+ validator: (value) {
78
+ accountListStore.validateAccountName(value);
79
+ return accountListStore.errorMessage;
80
+ },
81
+ )
82
)),
83
Observer(
84
builder: (_) => LoadingPrimaryButton(
@@ -93,13 +98,11 @@ class AccountFormState extends State<AccountForm> {
98
Navigator.of(context).pop(_textController.text);
99
},
100
text:
96
- widget.account != null ? 'Rename' : S.of(context).add,
97
- color: Theme.of(context)
98
- .primaryTextTheme
99
- .button
100
- .backgroundColor,
101
- textColor: Theme.of(context).primaryTextTheme.button.color,
101
+ widget.account != null ? S.of(context).rename : S.of(context).add,
102
+ color: Colors.green,
103
+ textColor: Colors.white,
104
isLoading: accountListStore.isAccountCreating,
105
+ isDisabled: accountListStore.isDisabledStatus,
106
))
107
],
108
),
lib/src/screens/accounts/widgets/account_tile.dart
new
+39
@@ -0,0 +1,39 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:cake_wallet/palette.dart';
3
+
4
+class AccountTile extends StatelessWidget {
5
+ AccountTile({
6
+ @required this.isCurrent,
7
+ @required this.accountName,
8
+ @required this.onTap
9
+ });
10
+
11
+ final bool isCurrent;
12
+ final String accountName;
13
+ final VoidCallback onTap;
14
+
15
+ @override
16
+ Widget build(BuildContext context) {
17
+ final color = isCurrent ? PaletteDark.menuHeader : Colors.transparent;
18
+ final textColor = isCurrent ? Colors.blue : Colors.white;
19
+
20
+ return GestureDetector(
21
+ onTap: onTap,
22
+ child: Container(
23
+ height: 77,
24
+ padding: EdgeInsets.only(left: 24, right: 24),
25
+ alignment: Alignment.centerLeft,
26
+ color: color,
27
+ child: Text(
28
+ accountName,
29
+ style: TextStyle(
30
+ fontSize: 18,
31
+ fontWeight: FontWeight.bold,
32
+ color: textColor,
33
+ decoration: TextDecoration.none,
34
+ ),
35
+ ),
36
+ ),
37
+ );
38
+ }
39
+}
\ No newline at end of file
lib/src/screens/dashboard/widgets/wallet_card.dart
+1
-1
@@ -433,7 +433,7 @@ class WalletCardState extends State<WalletCard> {
433
mainAxisAlignment: MainAxisAlignment.spaceBetween,
434
children: <Widget>[
435
Text(
436
- S.current.subaddresses,
436
+ S.of(context).accounts_subaddresses,
437
style: TextStyle(
438
fontSize: 14,
439
color: Colors.white
lib/src/screens/receive/receive_page.dart
+152
-193
@@ -11,6 +11,10 @@ import 'package:cake_wallet/src/stores/subaddress_list/subaddress_list_store.dar
11
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
12
import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
13
import 'package:cake_wallet/src/screens/base_page.dart';
14
+import 'package:cake_wallet/src/screens/accounts/account_list_page.dart';
15
+import 'package:cake_wallet/src/stores/account_list/account_list_store.dart';
16
+import 'package:cake_wallet/src/screens/receive/widgets/header_tile.dart';
17
+import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
18
19
class ReceivePage extends BasePage {
20
@override
@@ -37,7 +41,7 @@ class ReceivePage extends BasePage {
41
splashColor: Colors.transparent,
42
padding: EdgeInsets.all(0),
43
onPressed: () => Share.text(
40
- 'Share address', walletStore.subaddress.address, 'text/plain'),
44
+ S.current.share_address, walletStore.subaddress.address, 'text/plain'),
45
child: shareImage),
46
),
47
);
@@ -66,6 +70,7 @@ class ReceiveBodyState extends State<ReceiveBody> {
70
Widget build(BuildContext context) {
71
final walletStore = Provider.of<WalletStore>(context);
72
final subaddressListStore = Provider.of<SubaddressListStore>(context);
73
+ final accountListStore = Provider.of<AccountListStore>(context);
74
75
final copyImage = Image.asset('assets/images/copy_content.png');
76
@@ -122,231 +127,185 @@ class ReceiveBodyState extends State<ReceiveBody> {
127
Expanded(
128
child: Form(
129
key: _formKey,
125
- child: TextFormField(
126
- keyboardType:
127
- TextInputType.numberWithOptions(decimal: true),
130
+ child: BaseTextFormField(
131
+ controller: amountController,
132
+ keyboardType: TextInputType.numberWithOptions(decimal: true),
133
inputFormatters: [
134
BlacklistingTextInputFormatter(
135
RegExp('[\\-|\\ |\\,]'))
136
],
137
textAlign: TextAlign.center,
133
- style: TextStyle(
134
- fontSize: 20.0,
135
- color: Colors.white
136
- ),
137
- decoration: InputDecoration(
138
- hintStyle: TextStyle(
139
- fontSize: 20,
140
- color: PaletteDark.walletCardText),
141
- hintText: S.of(context).amount,
142
- focusedBorder: UnderlineInputBorder(
143
- borderSide: BorderSide(
144
- color: PaletteDark.walletCardText, width: 1.0)),
145
- enabledBorder: UnderlineInputBorder(
146
- borderSide: BorderSide(
147
- color: PaletteDark.walletCardText,
148
- width: 1.0))),
138
+ hintText: S.of(context).receive_amount,
139
+ borderColor: PaletteDark.walletCardText,
140
validator: (value) {
141
walletStore.validateAmount(value);
142
return walletStore.errorMessage;
143
},
144
autovalidate: true,
154
- controller: amountController,
155
- )))
145
+ )
146
+ )
147
+ )
148
],
149
),
150
),
151
Padding(
152
padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
153
child: Observer(
162
- builder: (_) => GestureDetector(
163
- onTap: () {
164
- Clipboard.setData(ClipboardData(
165
- text: walletStore.subaddress.address));
166
- Scaffold.of(context).showSnackBar(SnackBar(
167
- content: Text(
168
- S.of(context).copied_to_clipboard,
169
- style: TextStyle(color: Colors.white),
154
+ builder: (_) => GestureDetector(
155
+ onTap: () {
156
+ Clipboard.setData(ClipboardData(
157
+ text: walletStore.subaddress.address));
158
+ Scaffold.of(context).showSnackBar(SnackBar(
159
+ content: Text(
160
+ S.of(context).copied_to_clipboard,
161
+ style: TextStyle(color: Colors.white),
162
+ ),
163
+ backgroundColor: Colors.green,
164
+ duration: Duration(milliseconds: 500),
165
+ ));
166
+ },
167
+ child: Container(
168
+ height: 54,
169
+ padding: EdgeInsets.only(left: 24, right: 24),
170
+ decoration: BoxDecoration(
171
+ borderRadius: BorderRadius.all(Radius.circular(27)),
172
+ color: PaletteDark.walletCardSubAddressField
173
),
171
- backgroundColor: Colors.green,
172
- duration: Duration(milliseconds: 500),
173
- ));
174
- },
175
- child: Container(
176
- height: 54,
177
- padding: EdgeInsets.only(left: 24, right: 24),
178
- decoration: BoxDecoration(
179
- borderRadius: BorderRadius.all(Radius.circular(27)),
180
- color: PaletteDark.walletCardSubAddressField
181
- ),
182
- child: Row(
183
- mainAxisSize: MainAxisSize.max,
184
- children: <Widget>[
185
- Expanded(
186
- child: Text(
187
- walletStore.subaddress.address,
188
- maxLines: 1,
189
- overflow: TextOverflow.ellipsis,
190
- style: TextStyle(
191
- fontSize: 18,
192
- fontWeight: FontWeight.w600,
193
- color: Colors.white
174
+ child: Row(
175
+ mainAxisSize: MainAxisSize.max,
176
+ children: <Widget>[
177
+ Expanded(
178
+ child: Text(
179
+ walletStore.subaddress.address,
180
+ maxLines: 1,
181
+ overflow: TextOverflow.ellipsis,
182
+ style: TextStyle(
183
+ fontSize: 18,
184
+ fontWeight: FontWeight.w600,
185
+ color: Colors.white
186
+ ),
187
),
188
),
196
- ),
197
- Padding(
198
- padding: EdgeInsets.only(left: 12),
199
- child: copyImage,
200
- )
201
- ],
189
+ Padding(
190
+ padding: EdgeInsets.only(left: 12),
191
+ child: copyImage,
192
+ )
193
+ ],
194
+ ),
195
),
203
- ),
204
- )
196
+ )
197
),
198
),
199
Flexible(
208
- flex: 3,
209
- child: ClipRRect(
210
- borderRadius: BorderRadius.only(
211
- topLeft: Radius.circular(24),
212
- topRight: Radius.circular(24),
213
- ),
214
- child: Container(
215
- color: PaletteDark.historyPanel,
216
- child: Observer(
217
- builder: (_) => ListView.separated(
218
- separatorBuilder: (context, index) => Divider(
219
- height: 1,
220
- color: PaletteDark.menuList,
221
- ),
222
- itemCount: subaddressListStore.subaddresses.length + 2,
223
- itemBuilder: (context, index) {
200
+ flex: 3,
201
+ child: ClipRRect(
202
+ borderRadius: BorderRadius.only(
203
+ topLeft: Radius.circular(24),
204
+ topRight: Radius.circular(24),
205
+ ),
206
+ child: Container(
207
+ color: PaletteDark.historyPanel,
208
+ child: Observer(
209
+ builder: (_) => ListView.separated(
210
+ separatorBuilder: (context, index) => Divider(
211
+ height: 1,
212
+ color: PaletteDark.menuList,
213
+ ),
214
+ itemCount: subaddressListStore.subaddresses.length + 2,
215
+ itemBuilder: (context, index) {
216
225
- if (index == 0) {
226
- return accountTile(
227
- onTap: () {},
228
- title: walletStore.account.label,
229
- icon: Icon(
230
- Icons.arrow_forward_ios,
231
- size: 14,
232
- color: Colors.white,
233
- )
234
- );
235
- }
217
+ if (index == 0) {
218
+ return HeaderTile(
219
+ onTap: () async {
220
+ await showDialog<void>(
221
+ context: context,
222
+ builder: (BuildContext context) {
223
+ return AccountListPage(accountListStore: accountListStore);
224
+ }
225
+ );
226
+ },
227
+ title: walletStore.account.label,
228
+ icon: Icon(
229
+ Icons.arrow_forward_ios,
230
+ size: 14,
231
+ color: Colors.white,
232
+ )
233
+ );
234
+ }
235
237
- if (index == 1) {
238
- return accountTile(
239
- onTap: () => Navigator.of(context)
240
- .pushNamed(Routes.newSubaddress),
241
- title: S.of(context).subaddresses,
242
- icon: Icon(
243
- Icons.add,
244
- size: 20,
245
- color: Colors.white,
246
- )
247
- );
248
- }
236
+ if (index == 1) {
237
+ return HeaderTile(
238
+ onTap: () => Navigator.of(context)
239
+ .pushNamed(Routes.newSubaddress),
240
+ title: S.of(context).subaddresses,
241
+ icon: Icon(
242
+ Icons.add,
243
+ size: 20,
244
+ color: Colors.white,
245
+ )
246
+ );
247
+ }
248
250
- index -= 2;
249
+ index -= 2;
250
252
- return Observer(
253
- builder: (_) {
254
- final subaddress = subaddressListStore.subaddresses[index];
255
- final isCurrent =
256
- walletStore.subaddress.address == subaddress.address;
251
+ return Observer(
252
+ builder: (_) {
253
+ final subaddress = subaddressListStore.subaddresses[index];
254
+ final isCurrent =
255
+ walletStore.subaddress.address == subaddress.address;
256
258
- final label = subaddress.label;
259
- final address = subaddress.address;
257
+ final label = subaddress.label;
258
+ final address = subaddress.address;
259
261
- return InkWell(
262
- onTap: () => walletStore.setSubaddress(subaddress),
263
- child: Container(
264
- color: isCurrent ? currentColor : notCurrentColor,
265
- padding: EdgeInsets.only(
266
- left: 24,
267
- right: 24,
268
- top: 32,
269
- bottom: 32
270
- ),
271
- child: Column(
272
- mainAxisAlignment: MainAxisAlignment.start,
273
- crossAxisAlignment: CrossAxisAlignment.start,
274
- children: <Widget>[
275
- label.isNotEmpty
276
- ? Text(
277
- label,
278
- style: TextStyle(
279
- fontSize: 14,
280
- color: PaletteDark.walletCardText
260
+ return InkWell(
261
+ onTap: () => walletStore.setSubaddress(subaddress),
262
+ child: Container(
263
+ color: isCurrent ? currentColor : notCurrentColor,
264
+ padding: EdgeInsets.only(
265
+ left: 24,
266
+ right: 24,
267
+ top: 32,
268
+ bottom: 32
269
),
282
- )
283
- : Offstage(),
284
- Padding(
285
- padding: label.isNotEmpty
286
- ? EdgeInsets.only(top: 10)
287
- : EdgeInsets.only(top: 0),
288
- child: Text(
289
- address,
290
- style: TextStyle(
291
- fontSize: 16,
292
- fontWeight: FontWeight.w600,
293
- color: Colors.white
294
- ),
295
- ),
296
- )
297
- ]),
298
- ),
299
- );
300
- }
301
- );
302
- }
303
- )
270
+ child: Column(
271
+ mainAxisAlignment: MainAxisAlignment.start,
272
+ crossAxisAlignment: CrossAxisAlignment.start,
273
+ children: <Widget>[
274
+ label.isNotEmpty
275
+ ? Text(
276
+ label,
277
+ style: TextStyle(
278
+ fontSize: 14,
279
+ color: PaletteDark.walletCardText
280
+ ),
281
+ )
282
+ : Offstage(),
283
+ Padding(
284
+ padding: label.isNotEmpty
285
+ ? EdgeInsets.only(top: 10)
286
+ : EdgeInsets.only(top: 0),
287
+ child: Text(
288
+ address,
289
+ style: TextStyle(
290
+ fontSize: 16,
291
+ fontWeight: FontWeight.w600,
292
+ color: Colors.white
293
+ ),
294
+ ),
295
+ )
296
+ ]),
297
+ ),
298
+ );
299
+ }
300
+ );
301
+ }
302
+ )
303
+ ),
304
),
305
- ),
306
- )
305
+ )
306
)
307
],
308
),
309
);
310
}
312
-
313
- Widget accountTile({
314
- @required VoidCallback onTap,
315
- @required String title,
316
- @required Icon icon
317
- }) => GestureDetector(
318
- onTap: onTap,
319
- child: Container(
320
- padding: EdgeInsets.only(
321
- left: 24,
322
- right: 24,
323
- top: 32,
324
- bottom: 32
325
- ),
326
- color: Colors.transparent,
327
- child: Row(
328
- mainAxisSize: MainAxisSize.max,
329
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
330
- children: <Widget>[
331
- Text(
332
- title,
333
- style: TextStyle(
334
- fontSize: 18,
335
- fontWeight: FontWeight.bold,
336
- color: Colors.white
337
- ),
338
- ),
339
- Container(
340
- height: 32,
341
- width: 32,
342
- decoration: BoxDecoration(
343
- shape: BoxShape.circle,
344
- color: PaletteDark.menuList
345
- ),
346
- child: icon,
347
- )
348
- ],
349
- ),
350
- ),
351
- );
352
-}
311
+}
\ No newline at end of file
lib/src/screens/receive/widgets/header_tile.dart
new
+53
@@ -0,0 +1,53 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:cake_wallet/palette.dart';
3
+
4
+class HeaderTile extends StatelessWidget {
5
+ HeaderTile({
6
+ @required this.onTap,
7
+ @required this.title,
8
+ @required this.icon
9
+ });
10
+
11
+ final VoidCallback onTap;
12
+ final String title;
13
+ final Icon icon;
14
+
15
+ @override
16
+ Widget build(BuildContext context) {
17
+ return GestureDetector(
18
+ onTap: onTap,
19
+ child: Container(
20
+ padding: EdgeInsets.only(
21
+ left: 24,
22
+ right: 24,
23
+ top: 32,
24
+ bottom: 32
25
+ ),
26
+ color: Colors.transparent,
27
+ child: Row(
28
+ mainAxisSize: MainAxisSize.max,
29
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
30
+ children: <Widget>[
31
+ Text(
32
+ title,
33
+ style: TextStyle(
34
+ fontSize: 18,
35
+ fontWeight: FontWeight.bold,
36
+ color: Colors.white
37
+ ),
38
+ ),
39
+ Container(
40
+ height: 32,
41
+ width: 32,
42
+ decoration: BoxDecoration(
43
+ shape: BoxShape.circle,
44
+ color: PaletteDark.menuList
45
+ ),
46
+ child: icon,
47
+ )
48
+ ],
49
+ ),
50
+ ),
51
+ );
52
+ }
53
+}
\ No newline at end of file
lib/src/screens/subaddress/new_subaddress_page.dart
+46
-35
@@ -9,11 +9,15 @@ import 'package:cake_wallet/src/stores/subaddress_creation/subaddress_creation_s
9
import 'package:cake_wallet/src/widgets/primary_button.dart';
10
import 'package:cake_wallet/src/screens/base_page.dart';
11
import 'package:cake_wallet/palette.dart';
12
+import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
13
14
class NewSubaddressPage extends BasePage {
15
@override
16
String get title => S.current.new_subaddress_title;
17
18
+ @override
19
+ Color get backgroundColor => PaletteDark.historyPanel;
20
+
21
@override
22
Widget body(BuildContext context) => NewSubaddressForm();
23
@@ -42,40 +46,45 @@ class NewSubaddressFormState extends State<NewSubaddressForm> {
46
final _formKey = GlobalKey<FormState>();
47
final _labelController = TextEditingController();
48
49
+ @override
50
+ void dispose() {
51
+ _labelController.dispose();
52
+ super.dispose();
53
+ }
54
+
55
@override
56
Widget build(BuildContext context) {
57
final subaddressCreationStore =
58
Provider.of<SubadrressCreationStore>(context);
59
60
+ _labelController.addListener(() {
61
+ if (_labelController.text.isNotEmpty) {
62
+ subaddressCreationStore.setDisabledStatus(false);
63
+ } else {
64
+ subaddressCreationStore.setDisabledStatus(true);
65
+ }
66
+ });
67
+
68
return Form(
69
key: _formKey,
52
- child: Stack(children: <Widget>[
53
- Center(
54
- child: Padding(
55
- padding: EdgeInsets.only(left: 35, right: 35),
56
- child: TextFormField(
57
- controller: _labelController,
58
- decoration: InputDecoration(
59
- hintStyle: TextStyle(color: Theme.of(context).hintColor),
60
- hintText: S.of(context).new_subaddress_label_name,
61
- focusedBorder: UnderlineInputBorder(
62
- borderSide:
63
- BorderSide(color: Palette.cakeGreen, width: 2.0)),
64
- enabledBorder: UnderlineInputBorder(
65
- borderSide: BorderSide(
66
- color: Theme.of(context).focusColor,
67
- width: 1.0))),
68
- validator: (value) {
69
- subaddressCreationStore.validateSubaddressName(value);
70
- return subaddressCreationStore.errorMessage;
71
- }),
72
- ),
73
- ),
74
- Positioned(
75
- bottom: 20,
76
- left: 20,
77
- right: 20,
78
- child: Observer(
70
+ child: Container(
71
+ color: PaletteDark.historyPanel,
72
+ padding: EdgeInsets.all(24.0),
73
+ child: Column(
74
+ children: <Widget>[
75
+ Expanded(
76
+ child: Center(
77
+ child: BaseTextFormField(
78
+ controller: _labelController,
79
+ hintText: S.of(context).new_subaddress_label_name,
80
+ validator: (value) {
81
+ subaddressCreationStore.validateSubaddressName(value);
82
+ return subaddressCreationStore.errorMessage;
83
+ }
84
+ )
85
+ )
86
+ ),
87
+ Observer(
88
builder: (_) => LoadingPrimaryButton(
89
onPressed: () async {
90
if (_formKey.currentState.validate()) {
@@ -85,14 +94,16 @@ class NewSubaddressFormState extends State<NewSubaddressForm> {
94
}
95
},
96
text: S.of(context).new_subaddress_create,
88
- color: Theme.of(context)
89
- .accentTextTheme
90
- .button
91
- .backgroundColor,
92
- textColor: Theme.of(context).primaryTextTheme.button.color,
97
+ color: Colors.green,
98
+ textColor: Colors.white,
99
isLoading:
94
- subaddressCreationStore.state is SubaddressIsCreating),
95
- ))
96
- ]));
100
+ subaddressCreationStore.state is SubaddressIsCreating,
101
+ isDisabled: subaddressCreationStore.isDisabledStatus,
102
+ ),
103
+ )
104
+ ],
105
+ ),
106
+ )
107
+ );
108
}
109
}
lib/src/stores/account_list/account_list_store.dart
+9
@@ -16,6 +16,7 @@ abstract class AcountListStoreBase with Store {
16
AcountListStoreBase({@required WalletService walletService}) {
17
accounts = [];
18
isAccountCreating = false;
19
+ isDisabledStatus = true;
20
21
if (walletService.currentWallet != null) {
22
_onWalletChanged(walletService.currentWallet);
@@ -37,10 +38,18 @@ abstract class AcountListStoreBase with Store {
38
@observable
39
bool isAccountCreating;
40
41
+ @observable
42
+ bool isDisabledStatus;
43
+
44
AccountList _accountList;
45
StreamSubscription<Wallet> _onWalletChangeSubscription;
46
StreamSubscription<List<Account>> _onAccountsChangeSubscription;
47
48
+ @action
49
+ void setDisabledStatus(bool isDisabled) {
50
+ isDisabledStatus = isDisabled;
51
+ }
52
+
53
@override
54
void dispose() {
55
_onWalletChangeSubscription.cancel();
lib/src/stores/subaddress_creation/subaddress_creation_store.dart
+9
@@ -17,6 +17,7 @@ class SubadrressCreationStore = SubadrressCreationStoreBase
17
abstract class SubadrressCreationStoreBase with Store {
18
SubadrressCreationStoreBase({@required WalletService walletService}) {
19
state = SubaddressCreationStateInitial();
20
+ isDisabledStatus = true;
21
22
if (walletService.currentWallet != null) {
23
_onWalletChanged(walletService.currentWallet);
@@ -34,11 +35,19 @@ abstract class SubadrressCreationStoreBase with Store {
35
@observable
36
String errorMessage;
37
38
+ @observable
39
+ bool isDisabledStatus;
40
+
41
SubaddressList _subaddressList;
42
StreamSubscription<Wallet> _onWalletChangeSubscription;
43
StreamSubscription<Account> _onAccountChangeSubscription;
44
Account _account;
45
46
+ @action
47
+ void setDisabledStatus(bool isDisabled) {
48
+ isDisabledStatus = isDisabled;
49
+ }
50
+
51
@override
52
void dispose() {
53
_onWalletChangeSubscription.cancel();
lib/src/widgets/base_text_form_field.dart
new
+70
@@ -0,0 +1,70 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:cake_wallet/palette.dart';
3
+import 'package:flutter/services.dart';
4
+
5
+class BaseTextFormField extends StatelessWidget {
6
+ BaseTextFormField({
7
+ this.controller,
8
+ this.keyboardType = TextInputType.text,
9
+ this.textInputAction = TextInputAction.done,
10
+ this.textAlign = TextAlign.start,
11
+ this.autovalidate = false,
12
+ this.hintText = '',
13
+ this.maxLines = 1,
14
+ this.inputFormatters,
15
+ this.textColor = Colors.white,
16
+ this.hintColor = PaletteDark.walletCardText,
17
+ this.borderColor = PaletteDark.menuList,
18
+ this.validator
19
+ });
20
+
21
+ final TextEditingController controller;
22
+ final TextInputType keyboardType;
23
+ final TextInputAction textInputAction;
24
+ final TextAlign textAlign;
25
+ final bool autovalidate;
26
+ final String hintText;
27
+ final int maxLines;
28
+ final List<TextInputFormatter> inputFormatters;
29
+ final Color textColor;
30
+ final Color hintColor;
31
+ final Color borderColor;
32
+ final FormFieldValidator<String> validator;
33
+
34
+ @override
35
+ Widget build(BuildContext context) {
36
+ return TextFormField(
37
+ controller: controller,
38
+ keyboardType: keyboardType,
39
+ textInputAction: textInputAction,
40
+ textAlign: textAlign,
41
+ autovalidate: autovalidate,
42
+ maxLines: maxLines,
43
+ inputFormatters: inputFormatters,
44
+ style: TextStyle(
45
+ fontSize: 16.0,
46
+ color: textColor
47
+ ),
48
+ decoration: InputDecoration(
49
+ hintStyle: TextStyle(
50
+ color: hintColor,
51
+ fontSize: 16
52
+ ),
53
+ hintText: hintText,
54
+ focusedBorder: UnderlineInputBorder(
55
+ borderSide: BorderSide(
56
+ color: borderColor,
57
+ width: 1.0
58
+ )
59
+ ),
60
+ enabledBorder: UnderlineInputBorder(
61
+ borderSide: BorderSide(
62
+ color: borderColor,
63
+ width: 1.0
64
+ )
65
+ )
66
+ ),
67
+ validator: validator,
68
+ );
69
+ }
70
+}
\ No newline at end of file
res/values/strings_de.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "Adresse teilen ",
134
"receive_amount" : "Menge",
135
"subaddresses" : "Unteradressen",
136
+ "rename" : "Umbenennen",
137
+ "choose_account" : "Konto auswählen",
138
+ "create_new_account" : "Neues Konto erstellen",
139
+ "accounts_subaddresses" : "Konten und Unteradressen",
140
141
142
"restore_restore_wallet" : "Wallet wiederherstellen",
res/values/strings_en.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "Share address",
134
"receive_amount" : "Amount",
135
"subaddresses" : "Subaddresses",
136
+ "rename" : "Rename",
137
+ "choose_account" : "Choose account",
138
+ "create_new_account" : "Create new account",
139
+ "accounts_subaddresses" : "Accounts and subaddresses",
140
141
142
"restore_restore_wallet" : "Restore Wallet",
res/values/strings_es.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "Compartir dirección",
134
"receive_amount" : "Cantidad",
135
"subaddresses" : "Subdirecciones",
136
+ "rename" : "Rebautizar",
137
+ "choose_account" : "Elegir cuenta",
138
+ "create_new_account" : "Crear una nueva cuenta",
139
+ "accounts_subaddresses" : "Cuentas y subdirecciones",
140
141
142
"restore_restore_wallet" : "Recuperar Cartera",
res/values/strings_hi.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "पता साझा करें",
134
"receive_amount" : "रकम",
135
"subaddresses" : "उप पते",
136
+ "rename" : "नाम बदलें",
137
+ "choose_account" : "खाता चुनें",
138
+ "create_new_account" : "नया खाता बनाएँ",
139
+ "accounts_subaddresses" : "लेखा और उपदेस",
140
141
142
"restore_restore_wallet" : "वॉलेट को पुनर्स्थापित करें",
res/values/strings_ja.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "住所を共有する",
134
"receive_amount" : "量",
135
"subaddresses" : "サブアドレス",
136
+ "rename" : "リネーム",
137
+ "choose_account" : "アカウントを選択",
138
+ "create_new_account" : "新しいアカウントを作成する",
139
+ "accounts_subaddresses" : "アカウントとサブアドレス",
140
141
142
"restore_restore_wallet" : "ウォレットを復元",
res/values/strings_ko.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "주소 공유",
134
"receive_amount" : "양",
135
"subaddresses" : "하위 주소",
136
+ "rename" : "이름 바꾸기",
137
+ "choose_account" : "계정을 선택하십시오",
138
+ "create_new_account" : "새 계정을 만들",
139
+ "accounts_subaddresses" : "계정 및 하위 주소",
140
141
142
"restore_restore_wallet" : "월렛 복원",
res/values/strings_nl.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "Deel adres",
134
"receive_amount" : "Bedrag",
135
"subaddresses" : "Subadressen",
136
+ "rename" : "Hernoemen",
137
+ "choose_account" : "Kies account",
138
+ "create_new_account" : "Creëer een nieuw account",
139
+ "accounts_subaddresses" : "Accounts en subadressen",
140
141
142
"restore_restore_wallet" : "Portemonnee herstellen",
res/values/strings_pl.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "Udostępnij adres",
134
"receive_amount" : "Ilość",
135
"subaddresses" : "Podadresy",
136
+ "rename" : "Przemianować",
137
+ "choose_account" : "Wybierz konto",
138
+ "create_new_account" : "Stwórz nowe konto",
139
+ "accounts_subaddresses" : "Konta i podadresy",
140
141
142
"restore_restore_wallet" : "Przywróć portfel",
res/values/strings_pt.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "Compartilhar endereço",
134
"receive_amount" : "Quantia",
135
"subaddresses" : "Sub-endereços",
136
+ "rename" : "Renomear",
137
+ "choose_account" : "Escolha uma conta",
138
+ "create_new_account" : "Criar nova conta",
139
+ "accounts_subaddresses" : "Contas e sub-endereços",
140
141
142
"restore_restore_wallet" : "Restaurar carteira",
res/values/strings_ru.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "Поделиться адресом",
134
"receive_amount" : "Сумма",
135
"subaddresses" : "Субадреса",
136
+ "rename" : "Переименовать",
137
+ "choose_account" : "Выберите аккаунт",
138
+ "create_new_account" : "Создать новый аккаунт",
139
+ "accounts_subaddresses" : "Аккаунты и субадреса",
140
141
142
"restore_restore_wallet" : "Восстановить кошелёк",
res/values/strings_uk.arb
+5
-1
@@ -131,8 +131,12 @@
131
132
133
"share_address" : "Поділитися адресою",
134
- "receive_amount" : "Баланс",
134
+ "receive_amount" : "Сума",
135
"subaddresses" : "Субадреси",
136
+ "rename" : "Перейменувати",
137
+ "choose_account" : "Оберіть акаунт",
138
+ "create_new_account" : "Створити новий акаунт",
139
+ "accounts_subaddresses" : "Акаунти та субадреси",
140
141
142
"restore_restore_wallet" : "Відновити гаманець",
res/values/strings_zh.arb
+4
@@ -133,6 +133,10 @@
133
"share_address" : "分享地址",
134
"receive_amount" : "量",
135
"subaddresses" : "子地址",
136
+ "rename" : "改名",
137
+ "choose_account" : "選擇帳號",
138
+ "create_new_account" : "建立新帳戶",
139
+ "accounts_subaddresses" : "帳戶和子地址",
140
141
142
"restore_restore_wallet" : "恢复钱包",