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

View file

@ -86,25 +86,6 @@ class WalletMenu {
},
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/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/seed_language/widgets/seed_language_picker.dart';
import 'package:cake_wallet/src/screens/new_wallet/widgets/wallet_creation_dialog.dart';
class NewWalletPage extends BasePage {
NewWalletPage(
@ -44,40 +46,10 @@ class WalletNameForm extends StatefulWidget {
class _WalletNameFormState extends State<WalletNameForm> {
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 nameController = TextEditingController();
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
void dispose() {
nameController.dispose();
@ -89,24 +61,29 @@ class _WalletNameFormState extends State<WalletNameForm> {
final walletCreationStore = Provider.of<WalletCreationStore>(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) {
if (state is WalletCreatedSuccessfully) {
Navigator.of(context).popUntil((route) => route.isFirst);
}
if (state is WalletCreationFailure) { // FIXME: apply new alert dialog
if (state is WalletCreationFailure) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
content: Text(state.error),
actions: <Widget>[
FlatButton(
child: Text(S.of(context).ok),
onPressed: () => Navigator.of(context).pop(),
),
],
builder: (_) {
return WalletCreationDialog(
dialogTitle: S.current.new_wallet,
dialogContent: state.error,
dialogButtonText: S.of(context).ok,
dialogButtonAction: () => Navigator.of(context).pop()
);
});
});
@ -176,7 +153,10 @@ class _WalletNameFormState extends State<WalletNameForm> {
text: seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)],
color: PaletteDark.menuList,
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,
textColor: Colors.white,
isLoading: walletCreationStore.state is WalletIsCreating,
isDisabled: isDisabledButton,
isDisabled: walletCreationStore.isDisabledStatus,
);
},
)),

View file

@ -73,7 +73,7 @@ class WalletTypeFormState extends State<WalletTypeForm> {
Padding(
padding: EdgeInsets.only(top: 48),
child: Text(
'Please choose wallet currency:',
S.of(context).choose_wallet_currency,
textAlign: TextAlign.center,
style: TextStyle(
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:cake_wallet/palette.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:provider/provider.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';
class SeedLanguagePicker extends StatelessWidget {
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
];
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
];
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
Widget build(BuildContext context) {
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
return Observer(
builder: (_) => InkWell(
onTap: () => _setSeedLanguage(context),
return GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: Container(
color: Colors.transparent,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
child: Container(
padding: EdgeInsets.all(8.0),
//width: double.infinity,
decoration: BoxDecoration(
border: Border.all(
color: Theme.of(context).dividerTheme.color
),
borderRadius: BorderRadius.circular(8.0)
),
child: Text(seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)],
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16.0, color: Palette.lightBlue),
decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
padding: EdgeInsets.only(left: 24, right: 24),
child: Text(
S.of(context).seed_choose,
textAlign: TextAlign.center,
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 {
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
String selectedSeedLanguage =
await presentPicker(context, seedLocales);
Widget gridTile({
@required bool isCurrent,
@required Places place,
@required Image image,
@required String text,
@required VoidCallback onTap}) {
if (selectedSeedLanguage != null) {
selectedSeedLanguage = seedLanguages[seedLocales.indexOf(selectedSeedLanguage)];
seedLanguageStore.setSelectedSeedLanguage(selectedSeedLanguage);
BorderRadius borderRadius;
final color = isCurrent ? PaletteDark.historyPanel : PaletteDark.menuList;
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>[
PrimaryImageButton(
onPressed: () => Navigator.of(context).pushNamed(Routes.newWallet),
onPressed: () => Navigator.of(context).pushNamed(Routes.newWalletType),
image: newWalletImage,
text: S.of(context).wallet_list_create_new_wallet,
color: Colors.white,

View file

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

View file

@ -107,6 +107,7 @@
"new_wallet" : "Neues Wallet",
"wallet_name" : "Walletname",
"continue_text" : "Fortsetzen",
"choose_wallet_currency" : "Bitte wählen Sie die Brieftaschenwährung:",
"node_new" : "Neuer Knoten",
@ -158,7 +159,8 @@
"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_english" : "Englisch",
"seed_language_chinese" : "Chinesisch",

View file

@ -107,6 +107,7 @@
"new_wallet" : "New Wallet",
"wallet_name" : "Wallet name",
"continue_text" : "Continue",
"choose_wallet_currency" : "Please choose wallet currency:",
"node_new" : "New Node",
@ -158,7 +159,8 @@
"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_english" : "English",
"seed_language_chinese" : "Chinese",

View file

@ -107,6 +107,7 @@
"new_wallet" : "Nueva billetera",
"wallet_name" : "Nombre de la billetera",
"continue_text" : "Continuar",
"choose_wallet_currency" : "Por favor, elija la moneda de la billetera:",
"node_new" : "Nuevo nodo",
@ -158,7 +159,8 @@
"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_english" : "Inglés",
"seed_language_chinese" : "Chino",

View file

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

View file

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

View file

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

View file

@ -107,6 +107,7 @@
"new_wallet" : "Nieuwe portemonnee",
"wallet_name" : "Portemonnee naam",
"continue_text" : "Doorgaan met",
"choose_wallet_currency" : "Kies een portemonnee-valuta:",
"node_new" : "Nieuw knooppunt",
@ -158,7 +159,8 @@
"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_english" : "Engels",
"seed_language_chinese" : "Chinese",

View file

@ -107,6 +107,7 @@
"new_wallet" : "Nowy portfel",
"wallet_name" : "Nazwa portfela",
"continue_text" : "Dalej",
"choose_wallet_currency" : "Wybierz walutę portfela:",
"node_new" : "Nowy węzeł",
@ -158,7 +159,8 @@
"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_english" : "Angielski",
"seed_language_chinese" : "Chiński",

View file

@ -107,6 +107,7 @@
"new_wallet" : "Nova carteira",
"wallet_name" : "Nome da carteira",
"continue_text" : "Continuar",
"choose_wallet_currency" : "Escolha a moeda da carteira:",
"node_new" : "Novo nó",
@ -158,7 +159,8 @@
"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_english" : "Inglesa",
"seed_language_chinese" : "Chinesa",

View file

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

View file

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

View file

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