CWA-204 | applied new design to seed language picker; added wallet creation alert dialog

This commit is contained in:
Oleksandr Sobol 2020-04-29 22:57:54 +03:00
parent d9f8ddb141
commit ecca26bb58
53 changed files with 408 additions and 122 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,017 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,001 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

BIN
assets/images/2.0x/usa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/images/3.0x/usa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
assets/images/china.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

BIN
assets/images/germany.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
assets/images/holland.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

BIN
assets/images/india.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

BIN
assets/images/japan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

BIN
assets/images/poland.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

BIN
assets/images/portugal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 B

BIN
assets/images/russia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

BIN
assets/images/spain.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

BIN
assets/images/usa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

View file

@ -47,6 +47,7 @@ class S implements WidgetsLocalizations {
String get change_currency => "Change Currency"; String get change_currency => "Change Currency";
String get change_exchange_provider => "Change Exchange Provider"; String get change_exchange_provider => "Change Exchange Provider";
String get change_language => "Change language"; String get change_language => "Change language";
String get choose_wallet_currency => "Please choose wallet currency:";
String get clear => "Clear"; String get clear => "Clear";
String get confirm => "Confirm"; String get confirm => "Confirm";
String get confirm_sending => "Confirm sending"; String get confirm_sending => "Confirm sending";
@ -147,8 +148,9 @@ class S implements WidgetsLocalizations {
String get restore_wallet_restore_description => "Wallet restore description"; String get restore_wallet_restore_description => "Wallet restore description";
String get save => "Save"; String get save => "Save";
String get saved_the_trade_id => "I've saved the trade ID"; String get saved_the_trade_id => "I've saved the trade ID";
String get seed_choose => "Choose seed language";
String get seed_language_chinese => "Chinese"; String get seed_language_chinese => "Chinese";
String get seed_language_choose => "Please choose seed language"; String get seed_language_choose => "Please choose seed language:";
String get seed_language_dutch => "Dutch"; String get seed_language_dutch => "Dutch";
String get seed_language_english => "English"; String get seed_language_english => "English";
String get seed_language_german => "German"; String get seed_language_german => "German";
@ -397,7 +399,7 @@ class $de extends S {
@override @override
String get restore_title_from_keys => "Wiederherstellen von Schlüsseln"; String get restore_title_from_keys => "Wiederherstellen von Schlüsseln";
@override @override
String get seed_language_choose => "Bitte wählen Sie die Ausgangssprache"; String get seed_language_choose => "Bitte wählen Sie die Ausgangssprache:";
@override @override
String get wallet_keys => "Wallet schlüssel"; String get wallet_keys => "Wallet schlüssel";
@override @override
@ -425,6 +427,8 @@ class $de extends S {
@override @override
String get trade_details_pair => "Paar"; String get trade_details_pair => "Paar";
@override @override
String get choose_wallet_currency => "Bitte wählen Sie die Brieftaschenwährung:";
@override
String get confirm => "Bestätigen"; String get confirm => "Bestätigen";
@override @override
String get settings_display_balance_as => "Kontostand anzeigen als"; String get settings_display_balance_as => "Kontostand anzeigen als";
@ -647,6 +651,8 @@ class $de extends S {
@override @override
String get change_currency => "Währung ändern"; String get change_currency => "Währung ändern";
@override @override
String get seed_choose => "Wählen Sie die Ausgangssprache";
@override
String get transaction_details_amount => "Menge"; String get transaction_details_amount => "Menge";
@override @override
String get widgets_address => "Adresse"; String get widgets_address => "Adresse";
@ -971,7 +977,7 @@ class $hi extends S {
@override @override
String get restore_title_from_keys => "कुंजी से पुनर्स्थापित करें"; String get restore_title_from_keys => "कुंजी से पुनर्स्थापित करें";
@override @override
String get seed_language_choose => "कृपया बीज भाषा चुनें"; String get seed_language_choose => "कृपया बीज भाषा चुनें:";
@override @override
String get wallet_keys => "बटुआ की"; String get wallet_keys => "बटुआ की";
@override @override
@ -999,6 +1005,8 @@ class $hi extends S {
@override @override
String get trade_details_pair => "जोड़ा"; String get trade_details_pair => "जोड़ा";
@override @override
String get choose_wallet_currency => "कृपया बटुआ मुद्रा चुनें:";
@override
String get confirm => "की पुष्टि करें"; String get confirm => "की पुष्टि करें";
@override @override
String get settings_display_balance_as => "के रूप में संतुलन प्रदर्शित करें"; String get settings_display_balance_as => "के रूप में संतुलन प्रदर्शित करें";
@ -1221,6 +1229,8 @@ class $hi extends S {
@override @override
String get change_currency => "मुद्रा परिवर्तन करें"; String get change_currency => "मुद्रा परिवर्तन करें";
@override @override
String get seed_choose => "बीज भाषा चुनें";
@override
String get transaction_details_amount => "रकम"; String get transaction_details_amount => "रकम";
@override @override
String get widgets_address => "पता"; String get widgets_address => "पता";
@ -1545,7 +1555,7 @@ class $ru extends S {
@override @override
String get restore_title_from_keys => "Восстановить с помощью ключей"; String get restore_title_from_keys => "Восстановить с помощью ключей";
@override @override
String get seed_language_choose => "Пожалуйста, выберите язык мнемонической фразы"; String get seed_language_choose => "Пожалуйста, выберите язык мнемонической фразы:";
@override @override
String get wallet_keys => "Ключи кошелька"; String get wallet_keys => "Ключи кошелька";
@override @override
@ -1573,6 +1583,8 @@ class $ru extends S {
@override @override
String get trade_details_pair => "Пара"; String get trade_details_pair => "Пара";
@override @override
String get choose_wallet_currency => "Пожалуйста, выберите валюту кошелька:";
@override
String get confirm => "Подтвердить"; String get confirm => "Подтвердить";
@override @override
String get settings_display_balance_as => "Отображать баланс как"; String get settings_display_balance_as => "Отображать баланс как";
@ -1795,6 +1807,8 @@ class $ru extends S {
@override @override
String get change_currency => "Изменить валюту"; String get change_currency => "Изменить валюту";
@override @override
String get seed_choose => "Выберите язык мнемонической фразы";
@override
String get transaction_details_amount => "Сумма"; String get transaction_details_amount => "Сумма";
@override @override
String get widgets_address => "Адрес"; String get widgets_address => "Адрес";
@ -2119,7 +2133,7 @@ class $ko extends S {
@override @override
String get restore_title_from_keys => "키에서 복원"; String get restore_title_from_keys => "키에서 복원";
@override @override
String get seed_language_choose => "종자 언어를 선택하십시오"; String get seed_language_choose => "종자 언어를 선택하십시오:";
@override @override
String get wallet_keys => "지갑 키"; String get wallet_keys => "지갑 키";
@override @override
@ -2147,6 +2161,8 @@ class $ko extends S {
@override @override
String get trade_details_pair => ""; String get trade_details_pair => "";
@override @override
String get choose_wallet_currency => "지갑 통화를 선택하십시오:";
@override
String get confirm => "확인"; String get confirm => "확인";
@override @override
String get settings_display_balance_as => "잔액 표시"; String get settings_display_balance_as => "잔액 표시";
@ -2369,6 +2385,8 @@ class $ko extends S {
@override @override
String get change_currency => "통화 변경"; String get change_currency => "통화 변경";
@override @override
String get seed_choose => "시드 언어를 선택하십시오";
@override
String get transaction_details_amount => ""; String get transaction_details_amount => "";
@override @override
String get widgets_address => "주소"; String get widgets_address => "주소";
@ -2693,7 +2711,7 @@ class $pt extends S {
@override @override
String get restore_title_from_keys => "Restaurar a partir de chaves"; String get restore_title_from_keys => "Restaurar a partir de chaves";
@override @override
String get seed_language_choose => "Por favor, escolha o idioma da semente"; String get seed_language_choose => "Por favor, escolha o idioma da semente:";
@override @override
String get wallet_keys => "Chaves da carteira"; String get wallet_keys => "Chaves da carteira";
@override @override
@ -2721,6 +2739,8 @@ class $pt extends S {
@override @override
String get trade_details_pair => "Par"; String get trade_details_pair => "Par";
@override @override
String get choose_wallet_currency => "Escolha a moeda da carteira:";
@override
String get confirm => "Confirmar"; String get confirm => "Confirmar";
@override @override
String get settings_display_balance_as => "Saldo a exibir"; String get settings_display_balance_as => "Saldo a exibir";
@ -2943,6 +2963,8 @@ class $pt extends S {
@override @override
String get change_currency => "Alterar moeda"; String get change_currency => "Alterar moeda";
@override @override
String get seed_choose => "Escolha o idioma da semente";
@override
String get transaction_details_amount => "Quantia"; String get transaction_details_amount => "Quantia";
@override @override
String get widgets_address => "Endereço"; String get widgets_address => "Endereço";
@ -3267,7 +3289,7 @@ class $uk extends S {
@override @override
String get restore_title_from_keys => "Відновити за допомогою ключів"; String get restore_title_from_keys => "Відновити за допомогою ключів";
@override @override
String get seed_language_choose => "Будь ласка, виберіть мову мнемонічної фрази"; String get seed_language_choose => "Будь ласка, виберіть мову мнемонічної фрази:";
@override @override
String get wallet_keys => "Ключі гаманця"; String get wallet_keys => "Ключі гаманця";
@override @override
@ -3295,6 +3317,8 @@ class $uk extends S {
@override @override
String get trade_details_pair => "Пара"; String get trade_details_pair => "Пара";
@override @override
String get choose_wallet_currency => "Будь ласка, виберіть валюту гаманця:";
@override
String get confirm => "Підтвердити"; String get confirm => "Підтвердити";
@override @override
String get settings_display_balance_as => "Відображати баланс як"; String get settings_display_balance_as => "Відображати баланс як";
@ -3517,6 +3541,8 @@ class $uk extends S {
@override @override
String get change_currency => "Змінити валюту"; String get change_currency => "Змінити валюту";
@override @override
String get seed_choose => "Виберіть мову мнемонічної фрази";
@override
String get transaction_details_amount => "Сума"; String get transaction_details_amount => "Сума";
@override @override
String get widgets_address => "Адреса"; String get widgets_address => "Адреса";
@ -3841,7 +3867,7 @@ class $ja extends S {
@override @override
String get restore_title_from_keys => "キーから復元する"; String get restore_title_from_keys => "キーから復元する";
@override @override
String get seed_language_choose => "シード言語を選択してください"; String get seed_language_choose => "シード言語を選択してください:";
@override @override
String get wallet_keys => "ウォレットキー"; String get wallet_keys => "ウォレットキー";
@override @override
@ -3869,6 +3895,8 @@ class $ja extends S {
@override @override
String get trade_details_pair => "ペア"; String get trade_details_pair => "ペア";
@override @override
String get choose_wallet_currency => "ウォレット通貨を選択してください:";
@override
String get confirm => "確認する"; String get confirm => "確認する";
@override @override
String get settings_display_balance_as => "残高を表示"; String get settings_display_balance_as => "残高を表示";
@ -4091,6 +4119,8 @@ class $ja extends S {
@override @override
String get change_currency => "通貨を変更する"; String get change_currency => "通貨を変更する";
@override @override
String get seed_choose => "シード言語を選択してください";
@override
String get transaction_details_amount => ""; String get transaction_details_amount => "";
@override @override
String get widgets_address => "住所"; String get widgets_address => "住所";
@ -4419,7 +4449,7 @@ class $pl extends S {
@override @override
String get restore_title_from_keys => "Przywróć z kluczy"; String get restore_title_from_keys => "Przywróć z kluczy";
@override @override
String get seed_language_choose => "Proszę wybrać język początkowy"; String get seed_language_choose => "Proszę wybrać język początkowy:";
@override @override
String get wallet_keys => "Klucze portfela"; String get wallet_keys => "Klucze portfela";
@override @override
@ -4447,6 +4477,8 @@ class $pl extends S {
@override @override
String get trade_details_pair => "Para"; String get trade_details_pair => "Para";
@override @override
String get choose_wallet_currency => "Wybierz walutę portfela:";
@override
String get confirm => "Potwierdzać"; String get confirm => "Potwierdzać";
@override @override
String get settings_display_balance_as => "Wyświetl saldo jako"; String get settings_display_balance_as => "Wyświetl saldo jako";
@ -4669,6 +4701,8 @@ class $pl extends S {
@override @override
String get change_currency => "Change Currency"; String get change_currency => "Change Currency";
@override @override
String get seed_choose => "Wybierz język początkowy";
@override
String get transaction_details_amount => "Ilość"; String get transaction_details_amount => "Ilość";
@override @override
String get widgets_address => "Adres"; String get widgets_address => "Adres";
@ -4993,7 +5027,7 @@ class $es extends S {
@override @override
String get restore_title_from_keys => "De las claves"; String get restore_title_from_keys => "De las claves";
@override @override
String get seed_language_choose => "Por favor elija el idioma semilla"; String get seed_language_choose => "Por favor elija el idioma semilla:";
@override @override
String get wallet_keys => "Billetera clave"; String get wallet_keys => "Billetera clave";
@override @override
@ -5021,6 +5055,8 @@ class $es extends S {
@override @override
String get trade_details_pair => "Par"; String get trade_details_pair => "Par";
@override @override
String get choose_wallet_currency => "Por favor, elija la moneda de la billetera:";
@override
String get confirm => "Confirmar"; String get confirm => "Confirmar";
@override @override
String get settings_display_balance_as => "Mostrar saldo como"; String get settings_display_balance_as => "Mostrar saldo como";
@ -5243,6 +5279,8 @@ class $es extends S {
@override @override
String get change_currency => "Cambiar moneda"; String get change_currency => "Cambiar moneda";
@override @override
String get seed_choose => "Elige el idioma semilla";
@override
String get transaction_details_amount => "Cantidad"; String get transaction_details_amount => "Cantidad";
@override @override
String get widgets_address => "Dirección"; String get widgets_address => "Dirección";
@ -5567,7 +5605,7 @@ class $nl extends S {
@override @override
String get restore_title_from_keys => "Herstel van sleutels"; String get restore_title_from_keys => "Herstel van sleutels";
@override @override
String get seed_language_choose => "Kies een starttaal"; String get seed_language_choose => "Kies een starttaal:";
@override @override
String get wallet_keys => "Portemonnee sleutels"; String get wallet_keys => "Portemonnee sleutels";
@override @override
@ -5595,6 +5633,8 @@ class $nl extends S {
@override @override
String get trade_details_pair => "Paar"; String get trade_details_pair => "Paar";
@override @override
String get choose_wallet_currency => "Kies een portemonnee-valuta:";
@override
String get confirm => "Bevestigen"; String get confirm => "Bevestigen";
@override @override
String get settings_display_balance_as => "Toon saldo als"; String get settings_display_balance_as => "Toon saldo als";
@ -5817,6 +5857,8 @@ class $nl extends S {
@override @override
String get change_currency => "Verander valuta"; String get change_currency => "Verander valuta";
@override @override
String get seed_choose => "Kies een starttaal";
@override
String get transaction_details_amount => "Bedrag"; String get transaction_details_amount => "Bedrag";
@override @override
String get widgets_address => "Adres"; String get widgets_address => "Adres";
@ -6141,7 +6183,7 @@ class $zh extends S {
@override @override
String get restore_title_from_keys => "从密钥还原"; String get restore_title_from_keys => "从密钥还原";
@override @override
String get seed_language_choose => "請選擇種子語言"; String get seed_language_choose => "請選擇種子語言:";
@override @override
String get wallet_keys => "钱包钥匙"; String get wallet_keys => "钱包钥匙";
@override @override
@ -6169,6 +6211,8 @@ class $zh extends S {
@override @override
String get trade_details_pair => ""; String get trade_details_pair => "";
@override @override
String get choose_wallet_currency => "請選擇錢包貨幣:";
@override
String get confirm => "确认"; String get confirm => "确认";
@override @override
String get settings_display_balance_as => "将余额显示为"; String get settings_display_balance_as => "将余额显示为";
@ -6391,6 +6435,8 @@ class $zh extends S {
@override @override
String get change_currency => "更改币种"; String get change_currency => "更改币种";
@override @override
String get seed_choose => "選擇種子語言";
@override
String get transaction_details_amount => ""; String get transaction_details_amount => "";
@override @override
String get widgets_address => "地址"; String get widgets_address => "地址";

View file

@ -86,25 +86,6 @@ class WalletMenu {
}, },
reconnectActionRight: () => Navigator.of(context).pop() reconnectActionRight: () => Navigator.of(context).pop()
); );
/*AlertDialog(
title: Text(
S.of(context).reconnection,
textAlign: TextAlign.center,
),
content: Text(S.of(context).reconnect_alert_text),
actions: <Widget>[
FlatButton(
onPressed: () => Navigator.of(context).pop(),
child: Text(S.of(context).cancel)),
FlatButton(
onPressed: () {
walletStore.reconnect();
Navigator.of(context).pop();
},
child: Text(S.of(context).ok))
],
);*/
}); });
} }
} }

View file

@ -15,6 +15,8 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart'; import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart'; import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
import 'package:cake_wallet/src/screens/seed_language/widgets/seed_language_picker.dart';
import 'package:cake_wallet/src/screens/new_wallet/widgets/wallet_creation_dialog.dart';
class NewWalletPage extends BasePage { class NewWalletPage extends BasePage {
NewWalletPage( NewWalletPage(
@ -44,40 +46,10 @@ class WalletNameForm extends StatefulWidget {
class _WalletNameFormState extends State<WalletNameForm> { class _WalletNameFormState extends State<WalletNameForm> {
static const aspectRatioImage = 1.22; static const aspectRatioImage = 1.22;
final List<String> seedLocales = [
S.current.seed_language_english,
S.current.seed_language_chinese,
S.current.seed_language_dutch,
S.current.seed_language_german,
S.current.seed_language_japanese,
S.current.seed_language_portuguese,
S.current.seed_language_russian,
S.current.seed_language_spanish
];
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
final nameController = TextEditingController(); final nameController = TextEditingController();
final walletNameImage = Image.asset('assets/images/wallet_name.png'); final walletNameImage = Image.asset('assets/images/wallet_name.png');
bool isDisabledButton;
@override
void initState() {
isDisabledButton = true;
nameController.addListener(() {
if (nameController.text.isNotEmpty) {
isDisabledButton = false;
} else {
isDisabledButton = true;
}
setState(() {});
});
super.initState();
}
@override @override
void dispose() { void dispose() {
nameController.dispose(); nameController.dispose();
@ -89,24 +61,29 @@ class _WalletNameFormState extends State<WalletNameForm> {
final walletCreationStore = Provider.of<WalletCreationStore>(context); final walletCreationStore = Provider.of<WalletCreationStore>(context);
final seedLanguageStore = Provider.of<SeedLanguageStore>(context); final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
nameController.addListener(() {
if (nameController.text.isNotEmpty) {
walletCreationStore.setDisabledStatus(false);
} else {
walletCreationStore.setDisabledStatus(true);
}
});
reaction((_) => walletCreationStore.state, (WalletCreationState state) { reaction((_) => walletCreationStore.state, (WalletCreationState state) {
if (state is WalletCreatedSuccessfully) { if (state is WalletCreatedSuccessfully) {
Navigator.of(context).popUntil((route) => route.isFirst); Navigator.of(context).popUntil((route) => route.isFirst);
} }
if (state is WalletCreationFailure) { // FIXME: apply new alert dialog if (state is WalletCreationFailure) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showDialog<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (_) {
return AlertDialog( return WalletCreationDialog(
content: Text(state.error), dialogTitle: S.current.new_wallet,
actions: <Widget>[ dialogContent: state.error,
FlatButton( dialogButtonText: S.of(context).ok,
child: Text(S.of(context).ok), dialogButtonAction: () => Navigator.of(context).pop()
onPressed: () => Navigator.of(context).pop(),
),
],
); );
}); });
}); });
@ -176,7 +153,10 @@ class _WalletNameFormState extends State<WalletNameForm> {
text: seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)], text: seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)],
color: PaletteDark.menuList, color: PaletteDark.menuList,
textColor: Colors.white, textColor: Colors.white,
onTap: () {} // FIXME: apply picker onTap: () async => await showDialog(
context: context,
builder: (BuildContext context) => SeedLanguagePicker()
)
) )
), ),
) )
@ -195,7 +175,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
color: Colors.green, color: Colors.green,
textColor: Colors.white, textColor: Colors.white,
isLoading: walletCreationStore.state is WalletIsCreating, isLoading: walletCreationStore.state is WalletIsCreating,
isDisabled: isDisabledButton, isDisabled: walletCreationStore.isDisabledStatus,
); );
}, },
)), )),

View file

@ -73,7 +73,7 @@ class WalletTypeFormState extends State<WalletTypeForm> {
Padding( Padding(
padding: EdgeInsets.only(top: 48), padding: EdgeInsets.only(top: 48),
child: Text( child: Text(
'Please choose wallet currency:', S.of(context).choose_wallet_currency,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,

View file

@ -0,0 +1,56 @@
import 'package:flutter/material.dart';
import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
class WalletCreationDialog extends BaseAlertDialog {
WalletCreationDialog({
@required this.dialogTitle,
@required this.dialogContent,
@required this.dialogButtonText,
@required this.dialogButtonAction,
});
final String dialogTitle;
final String dialogContent;
final String dialogButtonText;
final VoidCallback dialogButtonAction;
@override
String get titleText => dialogTitle;
@override
String get contentText => dialogContent;
@override
Widget actionButtons(BuildContext context) {
return Container(
width: 300,
height: 52,
padding: EdgeInsets.only(left: 12, right: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24)
),
color: Colors.white
),
child: ButtonTheme(
minWidth: double.infinity,
child: FlatButton(
onPressed: dialogButtonAction,
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
child: Text(
dialogButtonText,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: Colors.blue,
decoration: TextDecoration.none,
),
)),
),
);
}
}

View file

@ -1,55 +1,245 @@
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart'; import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
import 'package:cake_wallet/src/widgets/present_picker.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
class SeedLanguagePicker extends StatelessWidget { List<String> seedLocales = [
List<String> seedLocales = [ S.current.seed_language_english,
S.current.seed_language_english, S.current.seed_language_chinese,
S.current.seed_language_chinese, S.current.seed_language_dutch,
S.current.seed_language_dutch, S.current.seed_language_german,
S.current.seed_language_german, S.current.seed_language_japanese,
S.current.seed_language_japanese, S.current.seed_language_portuguese,
S.current.seed_language_portuguese, S.current.seed_language_russian,
S.current.seed_language_russian, S.current.seed_language_spanish
S.current.seed_language_spanish ];
];
List<Image> flagImages = [
Image.asset('assets/images/usa.png'),
Image.asset('assets/images/china.png'),
Image.asset('assets/images/holland.png'),
Image.asset('assets/images/germany.png'),
Image.asset('assets/images/japan.png'),
Image.asset('assets/images/portugal.png'),
Image.asset('assets/images/russia.png'),
Image.asset('assets/images/spain.png'),
];
List<String> languageCodes = [
'Eng',
'Chi',
'Ned',
'Ger',
'Jap',
'Por',
'Rus',
'Esp',
];
enum Places {topLeft, topRight, bottomLeft, bottomRight, inside}
class SeedLanguagePicker extends StatefulWidget {
@override
SeedLanguagePickerState createState() => SeedLanguagePickerState();
}
class SeedLanguagePickerState extends State<SeedLanguagePicker> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final seedLanguageStore = Provider.of<SeedLanguageStore>(context); final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
return Observer( return GestureDetector(
builder: (_) => InkWell( onTap: () => Navigator.of(context).pop(),
onTap: () => _setSeedLanguage(context), child: Container(
color: Colors.transparent,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
child: Container( child: Container(
padding: EdgeInsets.all(8.0), decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)),
//width: double.infinity, child: Center(
decoration: BoxDecoration( child: Column(
border: Border.all( mainAxisSize: MainAxisSize.min,
color: Theme.of(context).dividerTheme.color children: <Widget>[
), Container(
borderRadius: BorderRadius.circular(8.0) padding: EdgeInsets.only(left: 24, right: 24),
), child: Text(
child: Text(seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)], S.of(context).seed_choose,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 16.0, color: Palette.lightBlue), style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Colors.white
),
),
),
Padding(
padding: EdgeInsets.only(top: 24),
child: GestureDetector(
onTap: () => null,
child: Container(
height: 300,
width: 300,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(14)),
color: PaletteDark.walletCardSubAddressField
),
child: GridView.count(
shrinkWrap: true,
crossAxisCount: 3,
childAspectRatio: 1,
physics: const NeverScrollableScrollPhysics(),
crossAxisSpacing: 1,
mainAxisSpacing: 1,
children: List.generate(9, (index) {
if (index == 8) {
return gridTile(
isCurrent: false,
place: Places.bottomRight,
image: null,
text: '',
onTap: null);
} else {
final code = languageCodes[index];
final flag = flagImages[index];
final isCurrent = index == seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage);
if (index == 0) {
return gridTile(
isCurrent: isCurrent,
place: Places.topLeft,
image: flag,
text: code,
onTap: () {
seedLanguageStore.setSelectedSeedLanguage(seedLanguages[index]);
Navigator.of(context).pop();
}
);
}
if (index == 2) {
return gridTile(
isCurrent: isCurrent,
place: Places.topRight,
image: flag,
text: code,
onTap: () {
seedLanguageStore.setSelectedSeedLanguage(seedLanguages[index]);
Navigator.of(context).pop();
}
);
}
if (index == 6) {
return gridTile(
isCurrent: isCurrent,
place: Places.bottomLeft,
image: flag,
text: code,
onTap: () {
seedLanguageStore.setSelectedSeedLanguage(seedLanguages[index]);
Navigator.of(context).pop();
}
);
}
return gridTile(
isCurrent: isCurrent,
place: Places.inside,
image: flag,
text: code,
onTap: () {
seedLanguageStore.setSelectedSeedLanguage(seedLanguages[index]);
Navigator.of(context).pop();
}
);
}
}),
),
),
),
)
],
),
), ),
), ),
)); ),
),
);
} }
Future<void> _setSeedLanguage(BuildContext context) async { Widget gridTile({
final seedLanguageStore = Provider.of<SeedLanguageStore>(context); @required bool isCurrent,
String selectedSeedLanguage = @required Places place,
await presentPicker(context, seedLocales); @required Image image,
@required String text,
@required VoidCallback onTap}) {
if (selectedSeedLanguage != null) { BorderRadius borderRadius;
selectedSeedLanguage = seedLanguages[seedLocales.indexOf(selectedSeedLanguage)]; final color = isCurrent ? PaletteDark.historyPanel : PaletteDark.menuList;
seedLanguageStore.setSelectedSeedLanguage(selectedSeedLanguage); final textColor = isCurrent ? Colors.blue : Colors.white;
switch (place) {
case Places.topLeft:
borderRadius = BorderRadius.only(topLeft: Radius.circular(14));
break;
case Places.topRight:
borderRadius = BorderRadius.only(topRight: Radius.circular(14));
break;
case Places.bottomLeft:
borderRadius = BorderRadius.only(bottomLeft: Radius.circular(14));
break;
case Places.bottomRight:
borderRadius = BorderRadius.only(bottomRight: Radius.circular(14));
break;
case Places.inside:
borderRadius = BorderRadius.all(Radius.circular(0));
break;
} }
return GestureDetector(
onTap: onTap,
child: Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: borderRadius,
color: color
),
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
image != null
? image
: Offstage(),
Padding(
padding: image != null
? EdgeInsets.only(left: 10)
: EdgeInsets.only(left: 0),
child: Text(
text,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: textColor
),
),
)
],
),
),
)
);
} }
} }

View file

@ -152,7 +152,7 @@ class WalletListBodyState extends State<WalletListBody> {
), ),
bottomSection: Column(children: <Widget>[ bottomSection: Column(children: <Widget>[
PrimaryImageButton( PrimaryImageButton(
onPressed: () => Navigator.of(context).pushNamed(Routes.newWallet), onPressed: () => Navigator.of(context).pushNamed(Routes.newWalletType),
image: newWalletImage, image: newWalletImage,
text: S.of(context).wallet_list_create_new_wallet, text: S.of(context).wallet_list_create_new_wallet,
color: Colors.white, color: Colors.white,

View file

@ -16,6 +16,7 @@ abstract class WalletCreationStoreBase with Store {
@required this.walletListService, @required this.walletListService,
@required this.sharedPreferences}) { @required this.sharedPreferences}) {
state = WalletCreationStateInitial(); state = WalletCreationStateInitial();
isDisabledStatus = true;
} }
final AuthenticationStore authStore; final AuthenticationStore authStore;
@ -31,6 +32,9 @@ abstract class WalletCreationStoreBase with Store {
@observable @observable
bool isValid; bool isValid;
@observable
bool isDisabledStatus;
@action @action
Future create({String name, String language}) async { Future create({String name, String language}) async {
state = WalletCreationStateInitial(); state = WalletCreationStateInitial();
@ -45,6 +49,11 @@ abstract class WalletCreationStoreBase with Store {
} }
} }
@action
void setDisabledStatus(bool isDisabled) {
isDisabledStatus = isDisabled;
}
void validateWalletName(String value) { void validateWalletName(String value) {
const pattern = '^[a-zA-Z0-9_]{1,15}\$'; const pattern = '^[a-zA-Z0-9_]{1,15}\$';
final regExp = RegExp(pattern); final regExp = RegExp(pattern);

View file

@ -107,6 +107,7 @@
"new_wallet" : "Neues Wallet", "new_wallet" : "Neues Wallet",
"wallet_name" : "Walletname", "wallet_name" : "Walletname",
"continue_text" : "Fortsetzen", "continue_text" : "Fortsetzen",
"choose_wallet_currency" : "Bitte wählen Sie die Brieftaschenwährung:",
"node_new" : "Neuer Knoten", "node_new" : "Neuer Knoten",
@ -158,7 +159,8 @@
"copy" : "Kopieren", "copy" : "Kopieren",
"seed_language_choose" : "Bitte wählen Sie die Ausgangssprache", "seed_language_choose" : "Bitte wählen Sie die Ausgangssprache:",
"seed_choose" : "Wählen Sie die Ausgangssprache",
"seed_language_next" : "Nächster", "seed_language_next" : "Nächster",
"seed_language_english" : "Englisch", "seed_language_english" : "Englisch",
"seed_language_chinese" : "Chinesisch", "seed_language_chinese" : "Chinesisch",

View file

@ -107,6 +107,7 @@
"new_wallet" : "New Wallet", "new_wallet" : "New Wallet",
"wallet_name" : "Wallet name", "wallet_name" : "Wallet name",
"continue_text" : "Continue", "continue_text" : "Continue",
"choose_wallet_currency" : "Please choose wallet currency:",
"node_new" : "New Node", "node_new" : "New Node",
@ -158,7 +159,8 @@
"copy" : "Copy", "copy" : "Copy",
"seed_language_choose" : "Please choose seed language", "seed_language_choose" : "Please choose seed language:",
"seed_choose" : "Choose seed language",
"seed_language_next" : "Next", "seed_language_next" : "Next",
"seed_language_english" : "English", "seed_language_english" : "English",
"seed_language_chinese" : "Chinese", "seed_language_chinese" : "Chinese",

View file

@ -107,6 +107,7 @@
"new_wallet" : "Nueva billetera", "new_wallet" : "Nueva billetera",
"wallet_name" : "Nombre de la billetera", "wallet_name" : "Nombre de la billetera",
"continue_text" : "Continuar", "continue_text" : "Continuar",
"choose_wallet_currency" : "Por favor, elija la moneda de la billetera:",
"node_new" : "Nuevo nodo", "node_new" : "Nuevo nodo",
@ -158,7 +159,8 @@
"copy" : "Dupdo", "copy" : "Dupdo",
"seed_language_choose" : "Por favor elija el idioma semilla", "seed_language_choose" : "Por favor elija el idioma semilla:",
"seed_choose" : "Elige el idioma semilla",
"seed_language_next" : "Próximo", "seed_language_next" : "Próximo",
"seed_language_english" : "Inglés", "seed_language_english" : "Inglés",
"seed_language_chinese" : "Chino", "seed_language_chinese" : "Chino",

View file

@ -107,6 +107,7 @@
"new_wallet" : "नया बटुआ", "new_wallet" : "नया बटुआ",
"wallet_name" : "बटुए का नाम", "wallet_name" : "बटुए का नाम",
"continue_text" : "जारी रहना", "continue_text" : "जारी रहना",
"choose_wallet_currency" : "कृपया बटुआ मुद्रा चुनें:",
"node_new" : "नया नोड", "node_new" : "नया नोड",
@ -158,7 +159,8 @@
"copy" : "प्रतिलिपि", "copy" : "प्रतिलिपि",
"seed_language_choose" : "कृपया बीज भाषा चुनें", "seed_language_choose" : "कृपया बीज भाषा चुनें:",
"seed_choose" : "बीज भाषा चुनें",
"seed_language_next" : "आगामी", "seed_language_next" : "आगामी",
"seed_language_english" : "अंग्रेज़ी", "seed_language_english" : "अंग्रेज़ी",
"seed_language_chinese" : "चीनी", "seed_language_chinese" : "चीनी",

View file

@ -107,6 +107,7 @@
"new_wallet" : "新しいウォレット", "new_wallet" : "新しいウォレット",
"wallet_name" : "ウォレット名", "wallet_name" : "ウォレット名",
"continue_text" : "持続する", "continue_text" : "持続する",
"choose_wallet_currency" : "ウォレット通貨を選択してください:",
"node_new" : "新しいノード", "node_new" : "新しいノード",
@ -158,7 +159,8 @@
"copy" : "コピー", "copy" : "コピー",
"seed_language_choose" : "シード言語を選択してください", "seed_language_choose" : "シード言語を選択してください:",
"seed_choose" : "シード言語を選択してください",
"seed_language_next" : "次", "seed_language_next" : "次",
"seed_language_english" : "英語", "seed_language_english" : "英語",
"seed_language_chinese" : "中国語", "seed_language_chinese" : "中国語",

View file

@ -107,6 +107,7 @@
"new_wallet" : "새 월렛", "new_wallet" : "새 월렛",
"wallet_name" : "지갑 이름", "wallet_name" : "지갑 이름",
"continue_text" : "잇다", "continue_text" : "잇다",
"choose_wallet_currency" : "지갑 통화를 선택하십시오:",
"node_new" : "새로운 노드", "node_new" : "새로운 노드",
@ -158,7 +159,8 @@
"copy" : "부", "copy" : "부",
"seed_language_choose" : "종자 언어를 선택하십시오", "seed_language_choose" : "종자 언어를 선택하십시오:",
"seed_choose" : "시드 언어를 선택하십시오",
"seed_language_next" : "다음 것", "seed_language_next" : "다음 것",
"seed_language_english" : "영어", "seed_language_english" : "영어",
"seed_language_chinese" : "중국말", "seed_language_chinese" : "중국말",

View file

@ -107,6 +107,7 @@
"new_wallet" : "Nieuwe portemonnee", "new_wallet" : "Nieuwe portemonnee",
"wallet_name" : "Portemonnee naam", "wallet_name" : "Portemonnee naam",
"continue_text" : "Doorgaan met", "continue_text" : "Doorgaan met",
"choose_wallet_currency" : "Kies een portemonnee-valuta:",
"node_new" : "Nieuw knooppunt", "node_new" : "Nieuw knooppunt",
@ -158,7 +159,8 @@
"copy" : "Kopiëren", "copy" : "Kopiëren",
"seed_language_choose" : "Kies een starttaal", "seed_language_choose" : "Kies een starttaal:",
"seed_choose" : "Kies een starttaal",
"seed_language_next" : "Volgende", "seed_language_next" : "Volgende",
"seed_language_english" : "Engels", "seed_language_english" : "Engels",
"seed_language_chinese" : "Chinese", "seed_language_chinese" : "Chinese",

View file

@ -107,6 +107,7 @@
"new_wallet" : "Nowy portfel", "new_wallet" : "Nowy portfel",
"wallet_name" : "Nazwa portfela", "wallet_name" : "Nazwa portfela",
"continue_text" : "Dalej", "continue_text" : "Dalej",
"choose_wallet_currency" : "Wybierz walutę portfela:",
"node_new" : "Nowy węzeł", "node_new" : "Nowy węzeł",
@ -158,7 +159,8 @@
"copy" : "Kopiuj", "copy" : "Kopiuj",
"seed_language_choose" : "Proszę wybrać język początkowy", "seed_language_choose" : "Proszę wybrać język początkowy:",
"seed_choose" : "Wybierz język początkowy",
"seed_language_next" : "Kolejny", "seed_language_next" : "Kolejny",
"seed_language_english" : "Angielski", "seed_language_english" : "Angielski",
"seed_language_chinese" : "Chiński", "seed_language_chinese" : "Chiński",

View file

@ -107,6 +107,7 @@
"new_wallet" : "Nova carteira", "new_wallet" : "Nova carteira",
"wallet_name" : "Nome da carteira", "wallet_name" : "Nome da carteira",
"continue_text" : "Continuar", "continue_text" : "Continuar",
"choose_wallet_currency" : "Escolha a moeda da carteira:",
"node_new" : "Novo nó", "node_new" : "Novo nó",
@ -158,7 +159,8 @@
"copy" : "Copiar", "copy" : "Copiar",
"seed_language_choose" : "Por favor, escolha o idioma da semente", "seed_language_choose" : "Por favor, escolha o idioma da semente:",
"seed_choose" : "Escolha o idioma da semente",
"seed_language_next" : "Próximo", "seed_language_next" : "Próximo",
"seed_language_english" : "Inglesa", "seed_language_english" : "Inglesa",
"seed_language_chinese" : "Chinesa", "seed_language_chinese" : "Chinesa",

View file

@ -107,6 +107,7 @@
"new_wallet" : "Новый кошелёк", "new_wallet" : "Новый кошелёк",
"wallet_name" : "Имя кошелька", "wallet_name" : "Имя кошелька",
"continue_text" : "Продолжить", "continue_text" : "Продолжить",
"choose_wallet_currency" : "Пожалуйста, выберите валюту кошелька:",
"node_new" : "Новая нода", "node_new" : "Новая нода",
@ -158,7 +159,8 @@
"copy" : "Скопировать", "copy" : "Скопировать",
"seed_language_choose" : "Пожалуйста, выберите язык мнемонической фразы", "seed_language_choose" : "Пожалуйста, выберите язык мнемонической фразы:",
"seed_choose" : "Выберите язык мнемонической фразы",
"seed_language_next" : "Продолжить", "seed_language_next" : "Продолжить",
"seed_language_english" : "Английский", "seed_language_english" : "Английский",
"seed_language_chinese" : "Китайский", "seed_language_chinese" : "Китайский",

View file

@ -107,6 +107,7 @@
"new_wallet" : "Новий гаманець", "new_wallet" : "Новий гаманець",
"wallet_name" : "Ім'я гаманця", "wallet_name" : "Ім'я гаманця",
"continue_text" : "Продовжити", "continue_text" : "Продовжити",
"choose_wallet_currency" : "Будь ласка, виберіть валюту гаманця:",
"node_new" : "Новий вузол", "node_new" : "Новий вузол",
@ -158,7 +159,8 @@
"copy" : "Скопіювати", "copy" : "Скопіювати",
"seed_language_choose" : "Будь ласка, виберіть мову мнемонічної фрази", "seed_language_choose" : "Будь ласка, виберіть мову мнемонічної фрази:",
"seed_choose" : "Виберіть мову мнемонічної фрази",
"seed_language_next" : "Продовжити", "seed_language_next" : "Продовжити",
"seed_language_english" : "Англійська", "seed_language_english" : "Англійська",
"seed_language_chinese" : "Китайська", "seed_language_chinese" : "Китайська",

View file

@ -107,6 +107,7 @@
"new_wallet" : "新钱包", "new_wallet" : "新钱包",
"wallet_name" : "钱包名称", "wallet_name" : "钱包名称",
"continue_text" : "继续", "continue_text" : "继续",
"choose_wallet_currency" : "請選擇錢包貨幣:",
"node_new" : "新节点", "node_new" : "新节点",
@ -158,7 +159,8 @@
"copy" : "复制", "copy" : "复制",
"seed_language_choose" : "請選擇種子語言", "seed_language_choose" : "請選擇種子語言:",
"seed_choose" : "選擇種子語言",
"seed_language_next" : "下一个", "seed_language_next" : "下一个",
"seed_language_english" : "英語", "seed_language_english" : "英語",
"seed_language_chinese" : "中文", "seed_language_chinese" : "中文",