CWA-175 | added seed language parameter to wallet manager and wallet list service, created seed_language_page and seed_language_store, applied seed language page before create and restore wallet, added mnemonics

This commit is contained in:
Oleksandr Sobol 2020-02-28 22:16:39 +02:00
parent ed31909694
commit cb4fff7aec
40 changed files with 11769 additions and 400 deletions

View file

@ -34,7 +34,7 @@ final loadWalletNative = moneroApi
void createWalletSync(
{String path,
String password,
String language = 'English',
String language,
int nettype = 0}) {
final pathPointer = Utf8.toUtf8(path);
final passwordPointer = Utf8.toUtf8(password);
@ -95,7 +95,7 @@ void restoreWalletFromSeedSync(
void restoreWalletFromKeysSync(
{String path,
String password,
String language = 'English',
String language,
String address,
String viewKey,
String spendKey,
@ -145,8 +145,9 @@ void loadWallet({String path, String password, int nettype = 0}) {
void _createWallet(Map<String, dynamic> args) {
final path = args['path'] as String;
final password = args['password'] as String;
final language = args['language'] as String;
createWalletSync(path: path, password: password);
createWalletSync(path: path, password: password, language: language);
}
void _restoreFromSeed(Map<String, dynamic> args) {
@ -162,6 +163,7 @@ void _restoreFromSeed(Map<String, dynamic> args) {
void _restoreFromKeys(Map<String, dynamic> args) {
final path = args['path'] as String;
final password = args['password'] as String;
final language = args['language'] as String;
final restoreHeight = args['restoreHeight'] as int;
final address = args['address'] as String;
final viewKey = args['viewKey'] as String;
@ -170,6 +172,7 @@ void _restoreFromKeys(Map<String, dynamic> args) {
restoreWalletFromKeysSync(
path: path,
password: password,
language: language,
restoreHeight: restoreHeight,
address: address,
viewKey: viewKey,
@ -190,7 +193,7 @@ Future<void> openWalletAsync(Map<String, String> args) async =>
Future<void> createWallet(
{String path,
String password,
String language = 'English',
String language,
int nettype = 0}) async =>
compute(_createWallet, {
'path': path,
@ -216,7 +219,7 @@ Future restoreFromSeed(
Future restoreFromKeys(
{String path,
String password,
String language = 'English',
String language,
String address,
String viewKey,
String spendKey,

View file

@ -144,12 +144,8 @@ 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_alert_first_text => "The next page will show\nyou a seed.";
String get seed_alert_menu => " menu.";
String get seed_alert_second_text => "Please write these down just in\ncase you lose or wipe your phone.";
String get seed_alert_settings => "settings";
String get seed_alert_third_text => "You can also see the seed again\nin the ";
String get seed_alert_understand => "I understand";
String get seed_language_choose => "Please choose seed language";
String get seed_language_next => "Next";
String get seed_share => "Share seed";
String get seed_title => "Seed";
String get send => "Send";
@ -358,8 +354,6 @@ class $de extends S {
@override
String get wallet_list_create_new_wallet => "Neue Wallet erstellen";
@override
String get seed_alert_third_text => "Sie können den Seed auch wieder sehen\nin dem ";
@override
String get setup_pin => "PIN einrichten";
@override
String get transaction_details_recipient_address => "Empfängeradresse";
@ -388,6 +382,8 @@ 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";
@override
String get wallet_keys => "Wallet schlüssel";
@override
String get reconnect => "Erneut verbinden";
@ -426,8 +422,6 @@ class $de extends S {
@override
String get trade_details_fetching => "Holen";
@override
String get seed_alert_menu => " Speisekarte.";
@override
String get confirm_sending => "Bestätigen Sie das Senden";
@override
String get settings_title => "die Einstellungen";
@ -570,8 +564,6 @@ class $de extends S {
@override
String get error_text_payment_id => "Die Zahlungs-ID kann nur 16 bis 64 hexadezimale Zeichen enthalten";
@override
String get seed_alert_second_text => "Bitte schreiben Sie diese nur in\nFalls Sie Ihr Telefon verlieren oder abwischen.";
@override
String get node_reset_settings_title => "Einstellungen zurücksetzen";
@override
String get wallets => "Wallets";
@ -638,8 +630,6 @@ class $de extends S {
@override
String get change => "Veränderung";
@override
String get seed_alert_first_text => "Die nächste Seite wird angezeigt\nDu bist ein Seed.";
@override
String get trade_state_finished => "Fertig";
@override
String get pin_is_incorrect => "PIN ist falsch";
@ -660,8 +650,6 @@ class $de extends S {
@override
String get rescan => "Erneut scannen";
@override
String get seed_alert_understand => "ich verstehe";
@override
String get show_keys => "Schlüssel anzeigen";
@override
String get error_text_fiat => "Der Wert des Betrags darf den verfügbaren Kontostand nicht überschreiten.\nDie Anzahl der Nachkommastellen muss kleiner oder gleich 2 sein";
@ -692,6 +680,8 @@ class $de extends S {
@override
String get restore_description_from_keys => "Stellen Sie Ihr Wallet von generiert wieder her\nTastenanschläge, die von Ihren privaten Schlüsseln gespeichert wurden";
@override
String get seed_language_next => "Nächster";
@override
String get sent => "Geschickt";
@override
String get view_key_public => "Schlüssel anzeigen (Öffentlichkeit)";
@ -708,8 +698,6 @@ class $de extends S {
@override
String get settings_save_recipient_address => "Empfängeradresse speichern";
@override
String get seed_alert_settings => "die Einstellungen";
@override
String get change_exchange_provider => "Wechseln Sie den Exchange-Anbieter";
@override
String get send_payment_id => "Zahlungs ID (wahlweise)";
@ -918,8 +906,6 @@ class $hi extends S {
@override
String get wallet_list_create_new_wallet => "नया बटुआ बनाएँ";
@override
String get seed_alert_third_text => "आप बीज को फिर से देख सकते हैं\nमें ";
@override
String get setup_pin => "पिन सेट करें";
@override
String get transaction_details_recipient_address => "प्राप्तकर्ता का पता";
@ -948,6 +934,8 @@ class $hi extends S {
@override
String get restore_title_from_keys => "कुंजी से पुनर्स्थापित करें";
@override
String get seed_language_choose => "कृपया बीज भाषा चुनें";
@override
String get wallet_keys => "बटुआ की";
@override
String get reconnect => "रिकनेक्ट";
@ -986,8 +974,6 @@ class $hi extends S {
@override
String get trade_details_fetching => "ला रहा है";
@override
String get seed_alert_menu => " मेन्यू.";
@override
String get confirm_sending => "भेजने की पुष्टि करें";
@override
String get settings_title => "सेटिंग्स";
@ -1130,8 +1116,6 @@ class $hi extends S {
@override
String get error_text_payment_id => "पेमेंट आईडी केवल हेक्स में 16 से 64 चार्ट तक हो सकती है";
@override
String get seed_alert_second_text => "कृपया इन्हें केवल मामले में लिखें\nआप अपना फोन खो देते हैं या मिटा देते हैं.";
@override
String get node_reset_settings_title => "सेटिंग्स को दुबारा करें";
@override
String get wallets => "पर्स";
@ -1198,8 +1182,6 @@ class $hi extends S {
@override
String get change => "परिवर्तन";
@override
String get seed_alert_first_text => "अगला पेज दिखाएगा\nतुम एक बीज हो.";
@override
String get trade_state_finished => "ख़त्म होना";
@override
String get pin_is_incorrect => "पिन गलत है";
@ -1220,8 +1202,6 @@ class $hi extends S {
@override
String get rescan => "पुन: स्कैन";
@override
String get seed_alert_understand => "मै समझता हुँ";
@override
String get show_keys => "चाबी दिखाओ";
@override
String get error_text_fiat => "राशि का मूल्य उपलब्ध शेष राशि से अधिक नहीं हो सकता.\nअंश अंकों की संख्या कम या 2 के बराबर होनी चाहिए";
@ -1252,6 +1232,8 @@ class $hi extends S {
@override
String get restore_description_from_keys => "अपने वॉलेट को जेनरेट से पुनर्स्थापित करें\nआपकी निजी कुंजी से कीस्ट्रोक्स सहेजे गए";
@override
String get seed_language_next => "आगामी";
@override
String get sent => "भेज दिया";
@override
String get view_key_public => "कुंजी देखें (जनता)";
@ -1268,8 +1250,6 @@ class $hi extends S {
@override
String get settings_save_recipient_address => "प्राप्तकर्ता का पता सहेजें";
@override
String get seed_alert_settings => "सेटिंग्स";
@override
String get change_exchange_provider => "एक्सचेंज प्रदाता बदलें";
@override
String get send_payment_id => "भुगतान ID (ऐच्छिक)";
@ -1478,8 +1458,6 @@ class $ru extends S {
@override
String get wallet_list_create_new_wallet => "Создать новый кошелёк";
@override
String get seed_alert_third_text => "Вы так же можете посмотреть вашу мнемоническую фразу\nв";
@override
String get setup_pin => "Настроить PIN";
@override
String get transaction_details_recipient_address => "Адрес получателя";
@ -1508,6 +1486,8 @@ class $ru extends S {
@override
String get restore_title_from_keys => "Восстановить с помощью ключей";
@override
String get seed_language_choose => "Пожалуйста, выберите язык семян";
@override
String get wallet_keys => "Ключи кошелька";
@override
String get reconnect => "Переподключиться";
@ -1546,8 +1526,6 @@ class $ru extends S {
@override
String get trade_details_fetching => "Получение";
@override
String get seed_alert_menu => " меню.";
@override
String get confirm_sending => "Подтвердить отправку";
@override
String get settings_title => "Настройки";
@ -1690,8 +1668,6 @@ class $ru extends S {
@override
String get error_text_payment_id => "Идентификатор платежа может содержать от 16 до 64 символов в hex";
@override
String get seed_alert_second_text => "Пожалуйста, запишите ее на\nслучай, если вы потеряете или отформатируете свой телефон.";
@override
String get node_reset_settings_title => "Сбросить настройки";
@override
String get wallets => "Кошельки";
@ -1758,8 +1734,6 @@ class $ru extends S {
@override
String get change => "Изменить";
@override
String get seed_alert_first_text => "Следущая страница содержит\nвашу мнемоническую фразу.";
@override
String get trade_state_finished => "Завершена";
@override
String get pin_is_incorrect => "Некорректный PIN";
@ -1780,8 +1754,6 @@ class $ru extends S {
@override
String get rescan => "Пересканировать";
@override
String get seed_alert_understand => "Я понимаю";
@override
String get show_keys => "Показать ключи";
@override
String get error_text_fiat => "Значение суммы не может превышать доступный баланс.\nКоличество цифр после запятой должно быть меньше или равно 2";
@ -1812,6 +1784,8 @@ class $ru extends S {
@override
String get restore_description_from_keys => "Вы можете восстановить кошелёк с помощью приватных ключей";
@override
String get seed_language_next => "Продолжить";
@override
String get sent => "Отправленные";
@override
String get view_key_public => "Публичный ключ просмотра";
@ -1828,8 +1802,6 @@ class $ru extends S {
@override
String get settings_save_recipient_address => "Сохранять адрес получателя";
@override
String get seed_alert_settings => "настройках";
@override
String get change_exchange_provider => "Изменить провайдера обмена";
@override
String get send_payment_id => "ID платежа (опционально)";
@ -2038,8 +2010,6 @@ class $ko extends S {
@override
String get wallet_list_create_new_wallet => "새 월렛 만들기";
@override
String get seed_alert_third_text => "당신은 또한 씨앗을 다시 볼 수 있습니다\n에서 ";
@override
String get setup_pin => "설정 PIN";
@override
String get transaction_details_recipient_address => "받는 사람 주소";
@ -2068,6 +2038,8 @@ class $ko extends S {
@override
String get restore_title_from_keys => "키에서 복원";
@override
String get seed_language_choose => "종자 언어를 선택하십시오";
@override
String get wallet_keys => "지갑 키";
@override
String get reconnect => "다시 연결";
@ -2106,8 +2078,6 @@ class $ko extends S {
@override
String get trade_details_fetching => "가져 오는 중";
@override
String get seed_alert_menu => " 메뉴.";
@override
String get confirm_sending => "전송 확인";
@override
String get settings_title => "설정";
@ -2250,8 +2220,6 @@ class $ko extends S {
@override
String get error_text_payment_id => "지불 ID는 16 ~ 64 자의 16 진 문자 만 포함 할 수 있습니다";
@override
String get seed_alert_second_text => "아래에 적어주세요\n휴대 전화를 분실하거나 닦을 경우.";
@override
String get node_reset_settings_title => "설정 초기화";
@override
String get wallets => "지갑";
@ -2318,8 +2286,6 @@ class $ko extends S {
@override
String get change => "변화";
@override
String get seed_alert_first_text => "다음 페이지가 표시됩니다\n당신은 씨앗.";
@override
String get trade_state_finished => "끝마친";
@override
String get pin_is_incorrect => "PIN이 잘못되었습니다";
@ -2340,8 +2306,6 @@ class $ko extends S {
@override
String get rescan => "재검색";
@override
String get seed_alert_understand => "이해 했어";
@override
String get show_keys => "키 표시";
@override
String get error_text_fiat => "금액은 사용 가능한 잔액을 초과 할 수 없습니다.\n소수 자릿수는 2보다 작거나 같아야합니다";
@ -2372,6 +2336,8 @@ class $ko extends S {
@override
String get restore_description_from_keys => "개인 키에서 저장된 생성 된\n키 스트로크에서 월렛 복원";
@override
String get seed_language_next => "다음 것";
@override
String get sent => "보냄";
@override
String get view_key_public => "키보기 (공공의)";
@ -2388,8 +2354,6 @@ class $ko extends S {
@override
String get settings_save_recipient_address => "수신자 주소 저장";
@override
String get seed_alert_settings => "설정";
@override
String get change_exchange_provider => "교환 공급자 변경";
@override
String get send_payment_id => "지불 ID (optional)";
@ -2598,8 +2562,6 @@ class $pt extends S {
@override
String get wallet_list_create_new_wallet => "Criar nova carteira";
@override
String get seed_alert_third_text => "Você também poderá ver a semente novamente\nna seção ";
@override
String get setup_pin => "Configurar PIN";
@override
String get transaction_details_recipient_address => "Endereço do destinatário";
@ -2628,6 +2590,8 @@ 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";
@override
String get wallet_keys => "Chaves da carteira";
@override
String get reconnect => "Reconectar";
@ -2666,8 +2630,6 @@ class $pt extends S {
@override
String get trade_details_fetching => "Buscando";
@override
String get seed_alert_menu => " do menu.";
@override
String get confirm_sending => "Confirmar o envio";
@override
String get settings_title => "Configurações";
@ -2810,8 +2772,6 @@ class $pt extends S {
@override
String get error_text_payment_id => "O ID de pagamento pode conter apenas de 16 a 64 caracteres em hexadecimal";
@override
String get seed_alert_second_text => "Anote a semente em um papel. Ela é o seu backup\n caso o seu telefone estrague ou seja perdido/roubado.";
@override
String get node_reset_settings_title => "Redefinir configurações";
@override
String get wallets => "Carteiras";
@ -2878,8 +2838,6 @@ class $pt extends S {
@override
String get change => "Mudar";
@override
String get seed_alert_first_text => "A próxima página exibirá\n uma semente.";
@override
String get trade_state_finished => "Finalizada";
@override
String get pin_is_incorrect => "PIN incorreto";
@ -2900,8 +2858,6 @@ class $pt extends S {
@override
String get rescan => "Reescanear";
@override
String get seed_alert_understand => "Eu entendi";
@override
String get show_keys => "Mostrar chaves";
@override
String get error_text_fiat => "O valor do valor não pode exceder o saldo disponível.\nO número de dígitos decimais deve ser menor ou igual a 2";
@ -2932,6 +2888,8 @@ class $pt extends S {
@override
String get restore_description_from_keys => "Restaure sua carteira a partir de \nsuas chaves privadas";
@override
String get seed_language_next => "Próximo";
@override
String get sent => "Enviada";
@override
String get view_key_public => "Chave de visualização (pública)";
@ -2948,8 +2906,6 @@ class $pt extends S {
@override
String get settings_save_recipient_address => "Salvar endereço do destinatário";
@override
String get seed_alert_settings => "configurações";
@override
String get change_exchange_provider => "Alterar o provedor de troca";
@override
String get send_payment_id => "ID de pagamento (opcional)";
@ -3158,8 +3114,6 @@ class $uk extends S {
@override
String get wallet_list_create_new_wallet => "Створити новий гаманець";
@override
String get seed_alert_third_text => "Також ви можете побачити вашу мнемонічну фразу\nв";
@override
String get setup_pin => "Встановити PIN";
@override
String get transaction_details_recipient_address => "Адреса отримувача";
@ -3188,6 +3142,8 @@ class $uk extends S {
@override
String get restore_title_from_keys => "Відновити за допомогою ключів";
@override
String get seed_language_choose => "Будь ласка, виберіть мову насіння";
@override
String get wallet_keys => "Ключі гаманця";
@override
String get reconnect => "Перепідключитися";
@ -3226,8 +3182,6 @@ class $uk extends S {
@override
String get trade_details_fetching => "Отримання";
@override
String get seed_alert_menu => " меню.";
@override
String get confirm_sending => "Підтвердити відправлення";
@override
String get settings_title => "Налаштування";
@ -3370,8 +3324,6 @@ class $uk extends S {
@override
String get error_text_payment_id => "Ідентифікатор платежу може містити від 16 до 64 символів в hex";
@override
String get seed_alert_second_text => "Будь ласка, запишіть її на \nвипадок, якщо ви втратите або відформатуєте ваш телефон.";
@override
String get node_reset_settings_title => "Скинути налаштування";
@override
String get wallets => "Гаманці";
@ -3438,8 +3390,6 @@ class $uk extends S {
@override
String get change => "Змінити";
@override
String get seed_alert_first_text => "Наступна сторінка містить\nвашу мнемонічну фразу.";
@override
String get trade_state_finished => "Завершена";
@override
String get pin_is_incorrect => "Некоректний PIN";
@ -3460,8 +3410,6 @@ class $uk extends S {
@override
String get rescan => "Пересканувати";
@override
String get seed_alert_understand => "Я розумію";
@override
String get show_keys => "Показати ключі";
@override
String get error_text_fiat => "Значення суми не може перевищувати доступний баланс.\nКількість цифр після коми повинно бути меншим або дорівнювати 2";
@ -3492,6 +3440,8 @@ class $uk extends S {
@override
String get restore_description_from_keys => "Ви можете відновити гаманець за допомогою приватних ключів";
@override
String get seed_language_next => "Продовжити";
@override
String get sent => "Відправлені";
@override
String get view_key_public => "Публічний ключ перегляду";
@ -3508,8 +3458,6 @@ class $uk extends S {
@override
String get settings_save_recipient_address => "Зберігати адресу отримувача";
@override
String get seed_alert_settings => "налаштуваннях";
@override
String get change_exchange_provider => "Змінити провайдера обміну";
@override
String get send_payment_id => "ID платежу (опційно)";
@ -3718,8 +3666,6 @@ class $ja extends S {
@override
String get wallet_list_create_new_wallet => "新しいウォレットを作成";
@override
String get seed_alert_third_text => "また、種子を見ることができます\nの中に ";
@override
String get setup_pin => "PINのセットアップ";
@override
String get transaction_details_recipient_address => "受取人の住所";
@ -3748,6 +3694,8 @@ class $ja extends S {
@override
String get restore_title_from_keys => "キーから復元する";
@override
String get seed_language_choose => "シード言語を選択してください";
@override
String get wallet_keys => "ウォレットキー";
@override
String get reconnect => "再接続";
@ -3786,8 +3734,6 @@ class $ja extends S {
@override
String get trade_details_fetching => "フェッチング";
@override
String get seed_alert_menu => " メニュー.";
@override
String get confirm_sending => "送信を確認";
@override
String get settings_title => "設定";
@ -3930,8 +3876,6 @@ class $ja extends S {
@override
String get error_text_payment_id => "支払いIDには、16進数で16〜64文字しか含めることができません";
@override
String get seed_alert_second_text => "これらを書き留めてください \n電話を紛失した場合や拭いた場合.";
@override
String get node_reset_settings_title => "設定をリセット";
@override
String get wallets => "財布";
@ -3998,8 +3942,6 @@ class $ja extends S {
@override
String get change => "変化する";
@override
String get seed_alert_first_text => "次のページが表示されます\nあなたは種.";
@override
String get trade_state_finished => "完成した";
@override
String get pin_is_incorrect => "PINが間違っています";
@ -4020,8 +3962,6 @@ class $ja extends S {
@override
String get rescan => "再スキャン";
@override
String get seed_alert_understand => "わかります";
@override
String get show_keys => "キーを表示";
@override
String get error_text_fiat => "金額は利用可能な残高を超えることはできません.\n小数桁の数は2以下でなければなりません";
@ -4052,6 +3992,8 @@ class $ja extends S {
@override
String get restore_description_from_keys => "生成されたウォレットを復元します\n秘密鍵から保存されたキーストローク";
@override
String get seed_language_next => "";
@override
String get sent => "送信済み";
@override
String get view_key_public => "ビューキー (パブリック)";
@ -4068,8 +4010,6 @@ class $ja extends S {
@override
String get settings_save_recipient_address => "受信者のアドレスを保存";
@override
String get seed_alert_settings => "設定";
@override
String get change_exchange_provider => "Exchangeプロバイダーの変更";
@override
String get send_payment_id => "支払いID (オプショナル)";
@ -4282,8 +4222,6 @@ class $pl extends S {
@override
String get wallet_list_create_new_wallet => "Utwórz nowy portfel";
@override
String get seed_alert_third_text => "Możesz także ponownie zobaczyć ziarno\nw ";
@override
String get setup_pin => "Ustaw PIN";
@override
String get transaction_details_recipient_address => "Adres odbiorcy";
@ -4312,6 +4250,8 @@ 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";
@override
String get wallet_keys => "Klucze portfela";
@override
String get reconnect => "Na nowo połączyć";
@ -4350,8 +4290,6 @@ class $pl extends S {
@override
String get trade_details_fetching => "Ujmujący";
@override
String get seed_alert_menu => " menu.";
@override
String get confirm_sending => "Potwierdź wysłanie";
@override
String get settings_title => "Ustawienia";
@ -4494,8 +4432,6 @@ class $pl extends S {
@override
String get error_text_payment_id => "ID może zawierać od 16 do 64 znaków w formacie szesnastkowym";
@override
String get seed_alert_second_text => "Zapisz je na wszelki wypadek\nzgubisz lub wyczyścisz telefon.";
@override
String get node_reset_settings_title => "Resetowanie ustawień";
@override
String get wallets => "Portfele";
@ -4562,8 +4498,6 @@ class $pl extends S {
@override
String get change => "Zmiana";
@override
String get seed_alert_first_text => "Pojawi się następna strona\nziarno.";
@override
String get trade_state_finished => "Skończone";
@override
String get pin_is_incorrect => "PPIN jest niepoprawny";
@ -4584,8 +4518,6 @@ class $pl extends S {
@override
String get rescan => "Skanuj ponownie";
@override
String get seed_alert_understand => "rozumiem";
@override
String get show_keys => "Pokaż klucze";
@override
String get error_text_fiat => "Wartość kwoty nie może przekroczyć dostępnego salda.\nLiczba cyfr ułamkowych musi być mniejsza lub równa 2";
@ -4616,6 +4548,8 @@ class $pl extends S {
@override
String get restore_description_from_keys => "Przywróć swój portfel z wygenerowanego\nnaciśnięcia klawiszy zapisane z kluczy prywatnych";
@override
String get seed_language_next => "Kolejny";
@override
String get sent => "Wysłano";
@override
String get view_key_public => "Wyświetl klucz (publiczny)";
@ -4632,8 +4566,6 @@ class $pl extends S {
@override
String get settings_save_recipient_address => "Zapisz adres odbiorcy";
@override
String get seed_alert_settings => "ustawienia";
@override
String get change_exchange_provider => "Zmień dostawcę programu Exchange";
@override
String get send_payment_id => "Identyfikator płatności (opcjonalny)";
@ -4842,8 +4774,6 @@ class $es extends S {
@override
String get wallet_list_create_new_wallet => "Crear nueva billetera";
@override
String get seed_alert_third_text => "También puede ver la semilla nuevamente \nen el ";
@override
String get setup_pin => "PIN de configuración";
@override
String get transaction_details_recipient_address => "Dirección del receptor";
@ -4872,6 +4802,8 @@ 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";
@override
String get wallet_keys => "Billetera clave";
@override
String get reconnect => "Volver a conectar";
@ -4910,8 +4842,6 @@ class $es extends S {
@override
String get trade_details_fetching => "Cargando";
@override
String get seed_alert_menu => " menú .";
@override
String get confirm_sending => "Confirmar envío";
@override
String get settings_title => "Configuraciones";
@ -5054,8 +4984,6 @@ class $es extends S {
@override
String get error_text_payment_id => "La ID de pago solo puede contener de 16 a 64 caracteres en hexadecimal";
@override
String get seed_alert_second_text => "Anótelos solo en caso de que pierda\no limpie su teléfono.";
@override
String get node_reset_settings_title => "Reiniciar ajustes";
@override
String get wallets => "Carteras";
@ -5122,8 +5050,6 @@ class $es extends S {
@override
String get change => "Cambio";
@override
String get seed_alert_first_text => "La siguiente página te mostrará \nuna semilla.";
@override
String get trade_state_finished => "Terminado";
@override
String get pin_is_incorrect => "PIN es incorrecto";
@ -5144,8 +5070,6 @@ class $es extends S {
@override
String get rescan => "Reescanear";
@override
String get seed_alert_understand => "Entiendo";
@override
String get show_keys => "Mostrar llaves";
@override
String get error_text_fiat => "El valor de la cantidad no puede exceder el saldo disponible.\nEl número de dígitos de fracción debe ser menor o igual a 2";
@ -5176,6 +5100,8 @@ class $es extends S {
@override
String get restore_description_from_keys => "Restaure su billetera de las pulsaciones de teclas generadas\nguardadas de sus claves privadas";
@override
String get seed_language_next => "Próximo";
@override
String get sent => "Expedido";
@override
String get view_key_public => "View clave (público)";
@ -5192,8 +5118,6 @@ class $es extends S {
@override
String get settings_save_recipient_address => "Guardar dirección del destinatario";
@override
String get seed_alert_settings => "de configuración";
@override
String get change_exchange_provider => "Cambiar proveedor de intercambio";
@override
String get send_payment_id => "ID de pago (opcional)";
@ -5402,8 +5326,6 @@ class $nl extends S {
@override
String get wallet_list_create_new_wallet => "Maak een nieuwe portemonnee";
@override
String get seed_alert_third_text => "Je kunt het zaad ook weer zien\nin de ";
@override
String get setup_pin => "PIN instellen";
@override
String get transaction_details_recipient_address => "Adres van de ontvanger";
@ -5432,6 +5354,8 @@ class $nl extends S {
@override
String get restore_title_from_keys => "Herstel van sleutels";
@override
String get seed_language_choose => "Kies een starttaal";
@override
String get wallet_keys => "Portemonnee sleutels";
@override
String get reconnect => "Sluit";
@ -5470,8 +5394,6 @@ class $nl extends S {
@override
String get trade_details_fetching => "Ophalen";
@override
String get seed_alert_menu => " menu.";
@override
String get confirm_sending => "Bevestig verzending";
@override
String get settings_title => "Instellingen";
@ -5614,8 +5536,6 @@ class $nl extends S {
@override
String get error_text_payment_id => "Betalings-ID kan alleen 16 tot 64 tekens bevatten in hexadecimale volgorde";
@override
String get seed_alert_second_text => "Noteer deze voor het geval dat\nje verliest of veegt je telefoon.";
@override
String get node_reset_settings_title => "Reset instellingen";
@override
String get wallets => "Portefeuilles";
@ -5682,8 +5602,6 @@ class $nl extends S {
@override
String get change => "Verandering";
@override
String get seed_alert_first_text => "De volgende pagina wordt getoond\njij een zaadje.";
@override
String get trade_state_finished => "Afgewerkt";
@override
String get pin_is_incorrect => "PIN is onjuist";
@ -5704,8 +5622,6 @@ class $nl extends S {
@override
String get rescan => "Opnieuw scannen";
@override
String get seed_alert_understand => "Ik begrijp het";
@override
String get show_keys => "Toon sleutels";
@override
String get error_text_fiat => "Waarde van bedrag kan het beschikbare saldo niet overschrijden.\nHet aantal breukcijfers moet kleiner zijn dan of gelijk zijn aan 2";
@ -5736,6 +5652,8 @@ class $nl extends S {
@override
String get restore_description_from_keys => "Herstel uw portemonnee van gegenereerd\ntoetsaanslagen opgeslagen van uw privésleutels";
@override
String get seed_language_next => "Volgende";
@override
String get sent => "Verzonden";
@override
String get view_key_public => "Bekijk sleutel (openbaar)";
@ -5752,8 +5670,6 @@ class $nl extends S {
@override
String get settings_save_recipient_address => "Adres ontvanger opslaan";
@override
String get seed_alert_settings => "instellingen";
@override
String get change_exchange_provider => "Wijzig Exchange Provider";
@override
String get send_payment_id => "Betaling ID (facultatief)";
@ -5962,8 +5878,6 @@ class $zh extends S {
@override
String get wallet_list_create_new_wallet => "创建新钱包";
@override
String get seed_alert_third_text => "您也可以再次看到种子 \n在里面";
@override
String get setup_pin => "设定PIN码";
@override
String get transaction_details_recipient_address => "收件人地址";
@ -5992,6 +5906,8 @@ class $zh extends S {
@override
String get restore_title_from_keys => "从密钥还原";
@override
String get seed_language_choose => "請選擇種子語言";
@override
String get wallet_keys => "钱包钥匙";
@override
String get reconnect => "重新连接";
@ -6030,8 +5946,6 @@ class $zh extends S {
@override
String get trade_details_fetching => "正在取得";
@override
String get seed_alert_menu => " 菜单.";
@override
String get confirm_sending => "确认发送";
@override
String get settings_title => "设定值";
@ -6174,8 +6088,6 @@ class $zh extends S {
@override
String get error_text_payment_id => "付款ID只能包含16到64个字符十六进制";
@override
String get seed_alert_second_text => "请写下来以防万一\n万一您丢失或擦拭手机.";
@override
String get node_reset_settings_title => "重新设置";
@override
String get wallets => "皮夹";
@ -6242,8 +6154,6 @@ class $zh extends S {
@override
String get change => "更改";
@override
String get seed_alert_first_text => "下一页将显示\n你是种子.";
@override
String get trade_state_finished => "已完成";
@override
String get pin_is_incorrect => "PIN码不正确";
@ -6264,8 +6174,6 @@ class $zh extends S {
@override
String get rescan => "重新扫描";
@override
String get seed_alert_understand => "我明白";
@override
String get show_keys => "显示按键";
@override
String get error_text_fiat => "金额不能超过可用余额.\n小数位数必须小于或等于2";
@ -6296,6 +6204,8 @@ class $zh extends S {
@override
String get restore_description_from_keys => "R从生成的电子钱包\n从您的私钥中保存的击键";
@override
String get seed_language_next => "下一个";
@override
String get sent => "已发送";
@override
String get view_key_public => "查看金钥 (public)";
@ -6312,8 +6222,6 @@ class $zh extends S {
@override
String get settings_save_recipient_address => "保存收件人地址";
@override
String get seed_alert_settings => "设定";
@override
String get change_exchange_provider => "更改交易所提供商";
@override
String get send_payment_id => "付款编号 (可选的)";

View file

@ -35,6 +35,7 @@ import 'package:cake_wallet/src/domain/common/wallet_type.dart';
import 'package:cake_wallet/src/domain/services/wallet_service.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/domain/common/language.dart';
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
@ -99,6 +100,7 @@ void main() async {
priceStore: priceStore);
final loginStore = LoginStore(
sharedPreferences: sharedPreferences, walletsService: walletListService);
final seedLanguageStore = SeedLanguageStore();
setReactions(
settingsStore: settingsStore,
@ -123,7 +125,8 @@ void main() async {
Provider(create: (_) => contacts),
Provider(create: (_) => nodes),
Provider(create: (_) => transactionDescriptions),
Provider(create: (_) => trades)
Provider(create: (_) => trades),
Provider(create: (_) => seedLanguageStore)
], child: CakeWalletApp()));
}

View file

@ -65,7 +65,7 @@ import 'package:cake_wallet/src/screens/restore/restore_wallet_from_seed_page.da
import 'package:cake_wallet/src/screens/restore/restore_wallet_from_keys_page.dart';
import 'package:cake_wallet/src/screens/send/send_page.dart';
import 'package:cake_wallet/src/screens/disclaimer/disclaimer_page.dart';
import 'package:cake_wallet/src/screens/seed_alert/seed_alert.dart';
import 'package:cake_wallet/src/screens/seed_language/seed_language_page.dart';
import 'package:cake_wallet/src/screens/transaction_details/transaction_details_page.dart';
import 'package:cake_wallet/src/screens/accounts/account_page.dart';
import 'package:cake_wallet/src/screens/accounts/account_list_page.dart';
@ -117,7 +117,7 @@ class Router {
sharedPreferences: sharedPreferences)),
child: SetupPinCodePage(
onPinCodeSetup: (context, _) =>
Navigator.pushNamed(context, Routes.newWallet))));
Navigator.pushNamed(context, Routes.seedLanguage))));
case Routes.newWallet:
return CupertinoPageRoute<void>(
@ -261,8 +261,8 @@ class Router {
return CupertinoPageRoute<void>(
builder: (_) => DisclaimerPage(isReadOnly: true));
case Routes.seedAlert:
return CupertinoPageRoute<void>(builder: (_) => SeedAlert());
case Routes.seedLanguage:
return CupertinoPageRoute<void>(builder: (_) => SeedLanguage());
case Routes.walletList:
return MaterialPageRoute<void>(

View file

@ -18,7 +18,7 @@ class Routes {
static const newSubaddress = '/new_subaddress';
static const disclaimer = '/disclaimer';
static const readDisclaimer = '/read_disclaimer';
static const seedAlert = '/seed_alert';
static const seedLanguage = '/seed_language';
static const walletList = '/wallet_list';
static const auth = '/auth';
static const nodeList = '/node_list';

View file

@ -2,12 +2,12 @@ import 'package:cake_wallet/src/domain/common/wallet.dart';
import 'package:cake_wallet/src/domain/common/wallet_description.dart';
abstract class WalletsManager {
Future<Wallet> create(String name, String password);
Future<Wallet> create(String name, String password, String language);
Future<Wallet> restoreFromSeed(
String name, String password, String seed, int restoreHeight);
Future<Wallet> restoreFromKeys(String name, String password,
Future<Wallet> restoreFromKeys(String name, String password, String language,
int restoreHeight, String address, String viewKey, String spendKey);
Future<Wallet> openWallet(String name, String password);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -31,12 +31,12 @@ class MoneroWalletsManager extends WalletsManager {
Box<WalletInfo> walletInfoSource;
@override
Future<Wallet> create(String name, String password) async {
Future<Wallet> create(String name, String password, String language) async {
try {
const isRecovery = false;
final path = await pathForWallet(name: name);
await monero_wallet_manager.createWallet(path: path, password: password);
await monero_wallet_manager.createWallet(path: path, password: password, language: language);
final wallet = await MoneroWallet.createdWallet(
walletInfoSource: walletInfoSource,
@ -82,6 +82,7 @@ class MoneroWalletsManager extends WalletsManager {
Future<Wallet> restoreFromKeys(
String name,
String password,
String language,
int restoreHeight,
String address,
String viewKey,
@ -93,6 +94,7 @@ class MoneroWalletsManager extends WalletsManager {
await monero_wallet_manager.restoreFromKeys(
path: path,
password: password,
language: language,
restoreHeight: restoreHeight,
address: address,
viewKey: viewKey,

View file

@ -41,7 +41,7 @@ class WalletListService {
.map((info) => WalletDescription(name: info.name, type: info.type))
.toList();
Future create(String name) async {
Future create(String name, String language) async {
if (await walletsManager.isWalletExit(name)) {
throw WalletIsExistException(name);
}
@ -53,7 +53,7 @@ class WalletListService {
final password = Uuid().v4();
await saveWalletPassword(password: password, walletName: name);
final wallet = await walletsManager.create(name, password);
final wallet = await walletsManager.create(name, password, language);
await onWalletChange(wallet);
}
@ -76,7 +76,7 @@ class WalletListService {
await onWalletChange(wallet);
}
Future restoreFromKeys(String name, int restoreHeight, String address,
Future restoreFromKeys(String name, String language, int restoreHeight, String address,
String viewKey, String spendKey) async {
if (await walletsManager.isWalletExit(name)) {
throw WalletIsExistException(name);
@ -90,7 +90,7 @@ class WalletListService {
await saveWalletPassword(password: password, walletName: name);
final wallet = await walletsManager.restoreFromKeys(
name, password, restoreHeight, address, viewKey, spendKey);
name, password, language, restoreHeight, address, viewKey, spendKey);
await onWalletChange(wallet);
}

View file

@ -13,6 +13,7 @@ import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
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';
class NewWalletPage extends BasePage {
NewWalletPage(
@ -43,6 +44,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
@override
Widget build(BuildContext context) {
final walletCreationStore = Provider.of<WalletCreationStore>(context);
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
reaction((_) => walletCreationStore.state, (WalletCreationState state) {
if (state is WalletCreatedSuccessfully) {
@ -107,7 +109,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
return LoadingPrimaryButton(
onPressed: () {
if (_formKey.currentState.validate()) {
walletCreationStore.create(name: nameController.text);
walletCreationStore.create(name: nameController.text,
language: seedLanguageStore.selectedSeedLanguage);
}
},
text: S.of(context).continue_text,

View file

@ -15,6 +15,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
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';
class RestoreWalletFromKeysPage extends BasePage {
RestoreWalletFromKeysPage(
@ -49,6 +50,7 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
@override
Widget build(BuildContext context) {
final walletRestorationStore = Provider.of<WalletRestorationStore>(context);
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
reaction((_) => walletRestorationStore.state, (WalletRestorationState state) {
if (state is WalletRestoredSuccessfully) {
@ -206,6 +208,7 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
if (_formKey.currentState.validate()) {
walletRestorationStore.restoreFromKeys(
name: _nameController.text,
language: seedLanguageStore.selectedSeedLanguage,
address: _addressController.text,
viewKey: _viewKeyController.text,
spendKey: _spendKeyController.text,

View file

@ -1,4 +1,3 @@
import 'package:mobx/mobx.dart';
import 'package:provider/provider.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
@ -11,6 +10,7 @@ import 'package:cake_wallet/src/domain/services/wallet_service.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/stores/wallet_restoration/wallet_restoration_store.dart';
import 'package:cake_wallet/src/widgets/seed_widget.dart';
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
class RestoreWalletFromSeedPage extends BasePage {
RestoreWalletFromSeedPage(
@ -53,6 +53,7 @@ class _RestoreFromSeedFormState extends State<RestoreFromSeedForm> {
@override
Widget build(BuildContext context) {
final walletRestorationStore = Provider.of<WalletRestorationStore>(context);
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
return GestureDetector(
onTap: () =>
@ -65,6 +66,7 @@ class _RestoreFromSeedFormState extends State<RestoreFromSeedForm> {
onFinish: () => Navigator.of(context).pushNamed(
Routes.restoreWalletFromSeedDetails,
arguments: _seedKey.currentState.items),
seedLanguage: seedLanguageStore.selectedSeedLanguage,
),
),
);

View file

@ -5,6 +5,8 @@ import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/screens/restore/widgets/restore_button.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
import 'package:provider/provider.dart';
class RestoreWalletOptionsPage extends BasePage {
static const _aspectRatioImage = 2.086;
@ -19,38 +21,46 @@ class RestoreWalletOptionsPage extends BasePage {
final _imageKeys = Image.asset('assets/images/keysIco.png');
@override
Widget body(BuildContext context) => Container(
padding: EdgeInsets.only(
left: 20.0,
right: 20.0,
),
child: Column(
children: <Widget>[
Flexible(
child: RestoreButton(
onPressed: () =>
Navigator.pushNamed(context, Routes.restoreWalletFromSeed),
image: _imageSeed,
aspectRatioImage: _aspectRatioImage,
titleColor: Palette.lightViolet,
color: Palette.lightViolet,
title: S.of(context).restore_title_from_seed,
description: S.of(context).restore_description_from_seed,
textButton: S.of(context).restore_next,
)),
Flexible(
child: RestoreButton(
onPressed: () =>
Navigator.pushNamed(context, Routes.restoreWalletFromKeys),
image: _imageKeys,
aspectRatioImage: _aspectRatioImage,
titleColor: Palette.cakeGreen,
color: Palette.cakeGreen,
title: S.of(context).restore_title_from_keys,
description: S.of(context).restore_description_from_keys,
textButton: S.of(context).restore_next,
))
],
),
);
Widget body(BuildContext context) {
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
return Container(
padding: EdgeInsets.only(
left: 20.0,
right: 20.0,
),
child: Column(
children: <Widget>[
Flexible(
child: RestoreButton(
onPressed: () {
seedLanguageStore.setCurrentRoute(Routes.restoreWalletFromSeed);
Navigator.pushNamed(context, Routes.seedLanguage);
},
image: _imageSeed,
aspectRatioImage: _aspectRatioImage,
titleColor: Palette.lightViolet,
color: Palette.lightViolet,
title: S.of(context).restore_title_from_seed,
description: S.of(context).restore_description_from_seed,
textButton: S.of(context).restore_next,
)),
Flexible(
child: RestoreButton(
onPressed: () {
seedLanguageStore.setCurrentRoute(Routes.restoreWalletFromKeys);
Navigator.pushNamed(context, Routes.seedLanguage);
},
image: _imageKeys,
aspectRatioImage: _aspectRatioImage,
titleColor: Palette.cakeGreen,
color: Palette.cakeGreen,
title: S.of(context).restore_title_from_keys,
description: S.of(context).restore_description_from_keys,
textButton: S.of(context).restore_next,
))
],
),
);
}
}

View file

@ -1,83 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
class SeedAlert extends StatelessWidget {
final imageSeed = Image.asset('assets/images/seedIco.png');
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomPadding: false,
backgroundColor: Theme.of(context).backgroundColor,
body: SafeArea(
child: Container(
padding: EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
Expanded(
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
imageSeed,
Text(
S.of(context).seed_alert_first_text,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 19.0),
),
SizedBox(
height: 20.0,
),
Text(
S.of(context).seed_alert_second_text,
textAlign: TextAlign.center,
style: TextStyle(
letterSpacing: 0.2,
fontSize: 16.0,
color: Palette.lightBlue),
),
SizedBox(
height: 20.0,
),
RichText(
textAlign: TextAlign.center,
text: TextSpan(children: <TextSpan>[
TextSpan(
text: S.of(context).seed_alert_third_text,
style: TextStyle(
letterSpacing: 0.2,
fontSize: 16.0,
color: Palette.lightBlue)),
TextSpan(
text: S.of(context).seed_alert_settings,
style: TextStyle(
letterSpacing: 0.2,
fontSize: 16.0,
color: Palette.lightGreen)),
TextSpan(
text: S.of(context).seed_alert_menu,
style: TextStyle(
letterSpacing: 0.2,
fontSize: 16.0,
color: Palette.lightBlue)),
]))
],
),
),
),
PrimaryButton(
onPressed: () {},
text: S.of(context).seed_alert_understand,
color:
Theme.of(context).primaryTextTheme.button.backgroundColor,
borderColor:
Theme.of(context).primaryTextTheme.button.decorationColor),
],
),
)),
);
}
}

View file

@ -0,0 +1,71 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/screens/base_page.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';
class SeedLanguage extends BasePage {
final imageSeed = Image.asset('assets/images/seedIco.png');
@override
Widget body(BuildContext context) {
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
return Container(
padding: EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
Expanded(
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
imageSeed,
Text(
S.of(context).seed_language_choose,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 19.0),
),
SizedBox(
height: 20.0,
),
Observer(
builder: (_) => InkWell(
onTap: () => _setSeedLanguage(context),
child: Text(seedLanguageStore.selectedSeedLanguage,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 19.0, color: Palette.lightBlue),
),
)),
],
),
),
),
PrimaryButton(
onPressed: () =>
Navigator.of(context).popAndPushNamed(seedLanguageStore.currentRoute),
text: S.of(context).seed_language_next,
color:
Theme.of(context).primaryTextTheme.button.backgroundColor,
borderColor:
Theme.of(context).primaryTextTheme.button.decorationColor),
],
),
);
}
Future<void> _setSeedLanguage(BuildContext context) async {
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
final selectedSeedLanguage =
await presentPicker(context, seedLanguages);
if (selectedSeedLanguage != null) {
seedLanguageStore.setSelectedSeedLanguage(selectedSeedLanguage);
}
}
}

View file

@ -17,6 +17,7 @@ import 'package:cake_wallet/src/screens/settings/attributes.dart';
import 'package:cake_wallet/src/screens/disclaimer/disclaimer_page.dart';
import 'package:cake_wallet/src/screens/settings/items/settings_item.dart';
import 'package:cake_wallet/src/screens/settings/items/item_headers.dart';
import 'package:cake_wallet/src/widgets/present_picker.dart';
// Settings widgets
import 'package:cake_wallet/src/screens/settings/widgets/settings_arrow_list_row.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_header_list_row.dart';
@ -393,51 +394,10 @@ class SettingsFormState extends State<SettingsForm> {
));
}
Future<T> _presentPicker<T extends Object>(
BuildContext context, List<T> list) async {
T _value = list[0];
return await showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(S.of(context).please_select),
backgroundColor: Theme.of(context).backgroundColor,
content: Container(
height: 150.0,
child: CupertinoPicker(
backgroundColor: Theme.of(context).backgroundColor,
itemExtent: 45.0,
onSelectedItemChanged: (int index) => _value = list[index],
children: List.generate(
list.length,
(index) => Center(
child: Text(
list[index].toString(),
style: TextStyle(
color: Theme.of(context)
.primaryTextTheme
.caption
.color),
),
))),
),
actions: <Widget>[
FlatButton(
onPressed: () => Navigator.of(context).pop(),
child: Text(S.of(context).cancel)),
FlatButton(
onPressed: () => Navigator.of(context).pop(_value),
child: Text(S.of(context).ok))
],
);
});
}
Future<void> _setBalance(BuildContext context) async {
final settingsStore = Provider.of<SettingsStore>(context);
final selectedDisplayMode =
await _presentPicker(context, BalanceDisplayMode.all);
await presentPicker(context, BalanceDisplayMode.all);
if (selectedDisplayMode != null) {
await settingsStore.setCurrentBalanceDisplayMode(
@ -447,7 +407,7 @@ class SettingsFormState extends State<SettingsForm> {
Future<void> _setCurrency(BuildContext context) async {
final settingsStore = Provider.of<SettingsStore>(context);
final selectedCurrency = await _presentPicker(context, FiatCurrency.all);
final selectedCurrency = await presentPicker(context, FiatCurrency.all);
if (selectedCurrency != null) {
await settingsStore.setCurrentFiatCurrency(currency: selectedCurrency);
@ -457,7 +417,7 @@ class SettingsFormState extends State<SettingsForm> {
Future<void> _setTransactionPriority(BuildContext context) async {
final settingsStore = Provider.of<SettingsStore>(context);
final selectedPriority =
await _presentPicker(context, TransactionPriority.all);
await presentPicker(context, TransactionPriority.all);
if (selectedPriority != null) {
await settingsStore.setCurrentTransactionPriority(

View file

@ -12,6 +12,7 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/src/stores/wallet_list/wallet_list_store.dart';
import 'package:cake_wallet/src/screens/wallet_list/wallet_menu.dart';
import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
class WalletListPage extends BasePage {
@override
@ -54,6 +55,7 @@ class WalletListBodyState extends State<WalletListBody> {
@override
Widget build(BuildContext context) {
_walletListStore = Provider.of<WalletListStore>(context);
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
return ScrollableWithBottomSection(
content: Container(
@ -100,8 +102,10 @@ class WalletListBodyState extends State<WalletListBody> {
),
bottomSection: Column(children: <Widget>[
PrimaryIconButton(
onPressed: () =>
Navigator.of(context).pushNamed(Routes.newWallet),
onPressed: () {
seedLanguageStore.setCurrentRoute(Routes.newWallet);
Navigator.of(context).pushNamed(Routes.seedLanguage);
},
iconData: Icons.add,
color: Theme.of(context).primaryTextTheme.button.backgroundColor,
borderColor:

View file

@ -0,0 +1,38 @@
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/routes.dart';
part 'seed_language_store.g.dart';
const List<String> seedLanguages = [
'English',
'Chinese (simplified)',
'Dutch',
'German',
'Japanese',
'Portuguese',
'Russian',
'Spanish'
];
class SeedLanguageStore = SeedLanguageStoreBase with _$SeedLanguageStore;
abstract class SeedLanguageStoreBase with Store {
SeedLanguageStoreBase() {
selectedSeedLanguage = seedLanguages[0];
currentRoute = Routes.newWallet;
}
@observable
String selectedSeedLanguage;
String currentRoute;
@action
void setSelectedSeedLanguage(String seedLanguage) {
selectedSeedLanguage = seedLanguage;
}
void setCurrentRoute(String route) {
currentRoute = route;
}
}

View file

@ -32,12 +32,12 @@ abstract class WalletCreationStoreBase with Store {
bool isValid;
@action
Future create({String name}) async {
Future create({String name, String language}) async {
state = WalletCreationStateInitial();
try {
state = WalletIsCreating();
await walletListService.create(name);
await walletListService.create(name, language);
authStore.created();
state = WalletCreatedSuccessfully();
} catch (e) {

View file

@ -56,6 +56,7 @@ abstract class WalleRestorationStoreBase with Store {
@action
Future restoreFromKeys(
{String name,
String language,
String address,
String viewKey,
String spendKey,
@ -65,7 +66,7 @@ abstract class WalleRestorationStoreBase with Store {
try {
state = WalletIsRestoring();
await walletListService.restoreFromKeys(
name, restoreHeight, address, viewKey, spendKey);
name, language, restoreHeight, address, viewKey, spendKey);
authStore.restored();
state = WalletRestoredSuccessfully();
} catch (e) {

View file

@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/generated/i18n.dart';
Future<T> presentPicker<T extends Object>(
BuildContext context, List<T> list) async {
T _value = list[0];
return await showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(S.of(context).please_select),
backgroundColor: Theme.of(context).backgroundColor,
content: Container(
height: 150.0,
child: CupertinoPicker(
backgroundColor: Theme.of(context).backgroundColor,
itemExtent: 45.0,
onSelectedItemChanged: (int index) => _value = list[index],
children: List.generate(
list.length,
(index) => Center(
child: Text(
list[index].toString(),
style: TextStyle(
color: Theme.of(context)
.primaryTextTheme
.caption
.color),
),
))),
),
actions: <Widget>[
FlatButton(
onPressed: () => Navigator.of(context).pop(),
child: Text(S.of(context).cancel)),
FlatButton(
onPressed: () => Navigator.of(context).pop(_value),
child: Text(S.of(context).ok))
],
);
});
}

View file

@ -4,14 +4,52 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/domain/monero/mnemonics/english.dart';
import 'package:cake_wallet/src/domain/monero/mnemonics/chinese_simplified.dart';
import 'package:cake_wallet/src/domain/monero/mnemonics/dutch.dart';
import 'package:cake_wallet/src/domain/monero/mnemonics/german.dart';
import 'package:cake_wallet/src/domain/monero/mnemonics/japanese.dart';
import 'package:cake_wallet/src/domain/monero/mnemonics/portuguese.dart';
import 'package:cake_wallet/src/domain/monero/mnemonics/russian.dart';
import 'package:cake_wallet/src/domain/monero/mnemonics/spanish.dart';
import 'package:cake_wallet/src/domain/common/mnemotic_item.dart';
import 'package:cake_wallet/generated/i18n.dart';
class SeedWidget extends StatefulWidget {
SeedWidget({Key key, this.onMnemoticChange, this.onFinish}) : super(key: key);
SeedWidget({Key key, this.onMnemoticChange, this.onFinish, this.seedLanguage}) : super(key: key) {
switch (seedLanguage) {
case 'English':
words = EnglishMnemonics.words;
break;
case 'Chinese (simplified)':
words = ChineseSimplifiedMnemonics.words;
break;
case 'Dutch':
words = DutchMnemonics.words;
break;
case 'German':
words = GermanMnemonics.words;
break;
case 'Japanese':
words = JapaneseMnemonics.words;
break;
case 'Portuguese':
words = PortugueseMnemonics.words;
break;
case 'Russian':
words = RussianMnemonics.words;
break;
case 'Spanish':
words = SpanishMnemonics.words;
break;
default:
words = EnglishMnemonics.words;
}
}
final Function(List<MnemoticItem>) onMnemoticChange;
final Function() onFinish;
final String seedLanguage;
List<String> words;
@override
SeedWidgetState createState() => SeedWidgetState();
@ -42,7 +80,7 @@ class SeedWidgetState extends State<SeedWidget> {
void addMnemotic(String text) {
setState(() => items.add(MnemoticItem(
text: text.trim().toLowerCase(), dic: EnglishMnemonics.words)));
text: text.trim().toLowerCase(), dic: widget.words)));
_seedController.text = '';
if (widget.onMnemoticChange != null) {
@ -141,7 +179,7 @@ class SeedWidgetState extends State<SeedWidget> {
}
currentMnemotics = splitted
.map((text) => MnemoticItem(text: text, dic: EnglishMnemonics.words))
.map((text) => MnemoticItem(text: text, dic: widget.words))
.toList();
bool isValid = true;

View file

@ -157,12 +157,8 @@
"copy" : "Kopieren",
"seed_alert_first_text" : "Die nächste Seite wird angezeigt\nDu bist ein Seed.",
"seed_alert_second_text" : "Bitte schreiben Sie diese nur in\nFalls Sie Ihr Telefon verlieren oder abwischen.",
"seed_alert_third_text" : "Sie können den Seed auch wieder sehen\nin dem ",
"seed_alert_settings" : "die Einstellungen",
"seed_alert_menu" : " Speisekarte.",
"seed_alert_understand" : "ich verstehe",
"seed_language_choose" : "Bitte wählen Sie die Ausgangssprache",
"seed_language_next" : "Nächster",
"send_title" : "Senden Sie Monero",

View file

@ -157,12 +157,8 @@
"copy" : "Copy",
"seed_alert_first_text" : "The next page will show\nyou a seed.",
"seed_alert_second_text" : "Please write these down just in\ncase you lose or wipe your phone.",
"seed_alert_third_text" : "You can also see the seed again\nin the ",
"seed_alert_settings" : "settings",
"seed_alert_menu" : " menu.",
"seed_alert_understand" : "I understand",
"seed_language_choose" : "Please choose seed language",
"seed_language_next" : "Next",
"send_title" : "Send Monero",

View file

@ -157,12 +157,8 @@
"copy" : "Dupdo",
"seed_alert_first_text" : "La siguiente página te mostrará \nuna semilla.",
"seed_alert_second_text" : "Anótelos solo en caso de que pierda\no limpie su teléfono.",
"seed_alert_third_text" : "También puede ver la semilla nuevamente \nen el ",
"seed_alert_settings" : "de configuración",
"seed_alert_menu" : " menú .",
"seed_alert_understand" : "Entiendo",
"seed_language_choose" : "Por favor elija el idioma semilla",
"seed_language_next" : "Próximo",
"send_title" : "Enviar Monero",

View file

@ -157,12 +157,8 @@
"copy" : "प्रतिलिपि",
"seed_alert_first_text" : "अगला पेज दिखाएगा\nतुम एक बीज हो.",
"seed_alert_second_text" : "कृपया इन्हें केवल मामले में लिखें\nआप अपना फोन खो देते हैं या मिटा देते हैं.",
"seed_alert_third_text" : "आप बीज को फिर से देख सकते हैं\nमें ",
"seed_alert_settings" : "सेटिंग्स",
"seed_alert_menu" : " मेन्यू.",
"seed_alert_understand" : "मै समझता हुँ",
"seed_language_choose" : "कृपया बीज भाषा चुनें",
"seed_language_next" : "आगामी",
"send_title" : "संदेश Monero",

View file

@ -157,12 +157,8 @@
"copy" : "コピー",
"seed_alert_first_text" : "次のページが表示されます\nあなたは種.",
"seed_alert_second_text" : "これらを書き留めてください \n電話を紛失した場合や拭いた場合.",
"seed_alert_third_text" : "また、種子を見ることができます\nの中に ",
"seed_alert_settings" : "設定",
"seed_alert_menu" : " メニュー.",
"seed_alert_understand" : "わかります",
"seed_language_choose" : "シード言語を選択してください",
"seed_language_next" : "次",
"send_title" : "Moneroを送信",

View file

@ -157,12 +157,8 @@
"copy" : "부",
"seed_alert_first_text" : "다음 페이지가 표시됩니다\n당신은 씨앗.",
"seed_alert_second_text" : "아래에 적어주세요\n휴대 전화를 분실하거나 닦을 경우.",
"seed_alert_third_text" : "당신은 또한 씨앗을 다시 볼 수 있습니다\n에서 ",
"seed_alert_settings" : "설정",
"seed_alert_menu" : " 메뉴.",
"seed_alert_understand" : "이해 했어",
"seed_language_choose" : "종자 언어를 선택하십시오",
"seed_language_next" : "다음 것",
"send_title" : "모네로 보내기",

View file

@ -157,12 +157,8 @@
"copy" : "Kopiëren",
"seed_alert_first_text" : "De volgende pagina wordt getoond\njij een zaadje.",
"seed_alert_second_text" : "Noteer deze voor het geval dat\nje verliest of veegt je telefoon.",
"seed_alert_third_text" : "Je kunt het zaad ook weer zien\nin de ",
"seed_alert_settings" : "instellingen",
"seed_alert_menu" : " menu.",
"seed_alert_understand" : "Ik begrijp het",
"seed_language_choose" : "Kies een starttaal",
"seed_language_next" : "Volgende",
"send_title" : "Stuur Monero",

View file

@ -157,12 +157,8 @@
"copy" : "Kopiuj",
"seed_alert_first_text" : "Pojawi się następna strona\nziarno.",
"seed_alert_second_text" : "Zapisz je na wszelki wypadek\nzgubisz lub wyczyścisz telefon.",
"seed_alert_third_text" : "Możesz także ponownie zobaczyć ziarno\nw ",
"seed_alert_settings" : "ustawienia",
"seed_alert_menu" : " menu.",
"seed_alert_understand" : "rozumiem",
"seed_language_choose" : "Proszę wybrać język początkowy",
"seed_language_next" : "Kolejny",
"send_title" : "Wyślij Monero",

View file

@ -157,12 +157,8 @@
"copy" : "Copiar",
"seed_alert_first_text" : "A próxima página exibirá\n uma semente.",
"seed_alert_second_text" : "Anote a semente em um papel. Ela é o seu backup\n caso o seu telefone estrague ou seja perdido/roubado.",
"seed_alert_third_text" : "Você também poderá ver a semente novamente\nna seção ",
"seed_alert_settings" : "configurações",
"seed_alert_menu" : " do menu.",
"seed_alert_understand" : "Eu entendi",
"seed_language_choose" : "Por favor, escolha o idioma da semente",
"seed_language_next" : "Próximo",
"send_title" : "Enviar Monero",

View file

@ -157,12 +157,8 @@
"copy" : "Скопировать",
"seed_alert_first_text" : "Следущая страница содержит\nвашу мнемоническую фразу.",
"seed_alert_second_text" : "Пожалуйста, запишите ее на\nслучай, если вы потеряете или отформатируете свой телефон.",
"seed_alert_third_text" : "Вы так же можете посмотреть вашу мнемоническую фразу\nв",
"seed_alert_settings" : "настройках",
"seed_alert_menu" : " меню.",
"seed_alert_understand" : "Я понимаю",
"seed_language_choose" : "Пожалуйста, выберите язык семян",
"seed_language_next" : "Продолжить",
"send_title" : "Отправить Monero",

View file

@ -157,12 +157,8 @@
"copy" : "Скопіювати",
"seed_alert_first_text" : "Наступна сторінка містить\nвашу мнемонічну фразу.",
"seed_alert_second_text" : "Будь ласка, запишіть її на \nвипадок, якщо ви втратите або відформатуєте ваш телефон.",
"seed_alert_third_text" : "Також ви можете побачити вашу мнемонічну фразу\nв",
"seed_alert_settings" : "налаштуваннях",
"seed_alert_menu" : " меню.",
"seed_alert_understand" : "Я розумію",
"seed_language_choose" : "Будь ласка, виберіть мову насіння",
"seed_language_next" : "Продовжити",
"send_title" : "Відправити Monero",

View file

@ -157,12 +157,8 @@
"copy" : "复制",
"seed_alert_first_text" : "下一页将显示\n你是种子.",
"seed_alert_second_text" : "请写下来以防万一\n万一您丢失或擦拭手机.",
"seed_alert_third_text" : "您也可以再次看到种子 \n在里面",
"seed_alert_settings" : "设定",
"seed_alert_menu" : " 菜单.",
"seed_alert_understand" : "我明白",
"seed_language_choose" : "請選擇種子語言",
"seed_language_next" : "下一个",
"send_title" : "发送门罗币",