Merge pull request #57 from cake-tech/CWA-209-rework-receive-screen

Cwa 209 rework receive screen
This commit is contained in:
Oleksandr Sobol 2020-05-12 16:19:20 +03:00 committed by GitHub
commit fdb4d3deae
35 changed files with 809 additions and 372 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
assets/images/share.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

View file

@ -23,6 +23,7 @@ class S implements WidgetsLocalizations {
String get account => "Account"; String get account => "Account";
String get accounts => "Accounts"; String get accounts => "Accounts";
String get accounts_subaddresses => "Accounts and subaddresses";
String get add => "Add"; String get add => "Add";
String get add_new_node => "Add new node"; String get add_new_node => "Add new node";
String get add_new_word => "Add new word"; String get add_new_word => "Add new word";
@ -48,6 +49,7 @@ class S implements WidgetsLocalizations {
String get change_currency => "Change Currency"; String get change_currency => "Change Currency";
String get change_exchange_provider => "Change Exchange Provider"; String get change_exchange_provider => "Change Exchange Provider";
String get change_language => "Change language"; String get change_language => "Change language";
String get choose_account => "Choose account";
String get choose_wallet_currency => "Please choose wallet currency:"; String get choose_wallet_currency => "Please choose wallet currency:";
String get clear => "Clear"; String get clear => "Clear";
String get confirm => "Confirm"; String get confirm => "Confirm";
@ -60,6 +62,7 @@ class S implements WidgetsLocalizations {
String get copy_address => "Copy Address"; String get copy_address => "Copy Address";
String get copy_id => "Copy ID"; String get copy_id => "Copy ID";
String get create_new => "Create New Wallet"; String get create_new => "Create New Wallet";
String get create_new_account => "Create new account";
String get delete => "Delete"; String get delete => "Delete";
String get digit_pin => "-digit PIN"; String get digit_pin => "-digit PIN";
String get edit => "Edit"; String get edit => "Edit";
@ -126,6 +129,7 @@ class S implements WidgetsLocalizations {
String get remove => "Remove"; String get remove => "Remove";
String get remove_node => "Remove node"; String get remove_node => "Remove node";
String get remove_node_message => "Are you sure that you want to remove selected node?"; String get remove_node_message => "Are you sure that you want to remove selected node?";
String get rename => "Rename";
String get rescan => "Rescan"; String get rescan => "Rescan";
String get reset => "Reset"; String get reset => "Reset";
String get restore_active_seed => "Active seed"; String get restore_active_seed => "Active seed";
@ -448,6 +452,8 @@ class $de extends S {
@override @override
String get trade_details_fetching => "Holen"; String get trade_details_fetching => "Holen";
@override @override
String get create_new_account => "Neues Konto erstellen";
@override
String get buy => "Kaufen"; String get buy => "Kaufen";
@override @override
String get confirm_sending => "Bestätigen Sie das Senden"; String get confirm_sending => "Bestätigen Sie das Senden";
@ -598,6 +604,8 @@ class $de extends S {
@override @override
String get change_language => "Sprache ändern"; String get change_language => "Sprache ändern";
@override @override
String get accounts_subaddresses => "Konten und Unteradressen";
@override
String get wallet_name => "Walletname"; String get wallet_name => "Walletname";
@override @override
String get error_text_payment_id => "Die Zahlungs-ID kann nur 16 bis 64 hexadezimale Zeichen enthalten"; String get error_text_payment_id => "Die Zahlungs-ID kann nur 16 bis 64 hexadezimale Zeichen enthalten";
@ -686,6 +694,8 @@ class $de extends S {
@override @override
String get settings_fee_priority => "Gebührenpriorität"; String get settings_fee_priority => "Gebührenpriorität";
@override @override
String get rename => "Umbenennen";
@override
String get restore_active_seed => "Aktives Seed"; String get restore_active_seed => "Aktives Seed";
@override @override
String get settings_personal => "persönlich"; String get settings_personal => "persönlich";
@ -712,6 +722,8 @@ class $de extends S {
@override @override
String get spend_key_private => "Schlüssel ausgeben (geheim)"; String get spend_key_private => "Schlüssel ausgeben (geheim)";
@override @override
String get choose_account => "Konto auswählen";
@override
String get settings_only_trades => "Nur Trades"; String get settings_only_trades => "Nur Trades";
@override @override
String get trade_state_to_be_created => "Geschaffen werden"; String get trade_state_to_be_created => "Geschaffen werden";
@ -1032,6 +1044,8 @@ class $hi extends S {
@override @override
String get trade_details_fetching => "ला रहा है"; String get trade_details_fetching => "ला रहा है";
@override @override
String get create_new_account => "नया खाता बनाएँ";
@override
String get buy => "खरीदें"; String get buy => "खरीदें";
@override @override
String get confirm_sending => "भेजने की पुष्टि करें"; String get confirm_sending => "भेजने की पुष्टि करें";
@ -1182,6 +1196,8 @@ class $hi extends S {
@override @override
String get change_language => "भाषा बदलो"; String get change_language => "भाषा बदलो";
@override @override
String get accounts_subaddresses => "लेखा और उपदेस";
@override
String get wallet_name => "बटुए का नाम"; String get wallet_name => "बटुए का नाम";
@override @override
String get error_text_payment_id => "पेमेंट आईडी केवल हेक्स में 16 से 64 चार्ट तक हो सकती है"; String get error_text_payment_id => "पेमेंट आईडी केवल हेक्स में 16 से 64 चार्ट तक हो सकती है";
@ -1270,6 +1286,8 @@ class $hi extends S {
@override @override
String get settings_fee_priority => "शुल्क प्राथमिकता"; String get settings_fee_priority => "शुल्क प्राथमिकता";
@override @override
String get rename => "नाम बदलें";
@override
String get restore_active_seed => "सक्रिय बीज"; String get restore_active_seed => "सक्रिय बीज";
@override @override
String get settings_personal => "निजी"; String get settings_personal => "निजी";
@ -1296,6 +1314,8 @@ class $hi extends S {
@override @override
String get spend_key_private => "खर्च करना (निजी)"; String get spend_key_private => "खर्च करना (निजी)";
@override @override
String get choose_account => "खाता चुनें";
@override
String get settings_only_trades => "केवल ट्रेड करता है"; String get settings_only_trades => "केवल ट्रेड करता है";
@override @override
String get trade_state_to_be_created => "बनाए जाने के लिए"; String get trade_state_to_be_created => "बनाए जाने के लिए";
@ -1616,6 +1636,8 @@ class $ru extends S {
@override @override
String get trade_details_fetching => "Получение"; String get trade_details_fetching => "Получение";
@override @override
String get create_new_account => "Создать новый аккаунт";
@override
String get buy => "Купить"; String get buy => "Купить";
@override @override
String get confirm_sending => "Подтвердить отправку"; String get confirm_sending => "Подтвердить отправку";
@ -1766,6 +1788,8 @@ class $ru extends S {
@override @override
String get change_language => "Изменить язык"; String get change_language => "Изменить язык";
@override @override
String get accounts_subaddresses => "Аккаунты и субадреса";
@override
String get wallet_name => "Имя кошелька"; String get wallet_name => "Имя кошелька";
@override @override
String get error_text_payment_id => "Идентификатор платежа может содержать от 16 до 64 символов в hex"; String get error_text_payment_id => "Идентификатор платежа может содержать от 16 до 64 символов в hex";
@ -1854,6 +1878,8 @@ class $ru extends S {
@override @override
String get settings_fee_priority => "Приоритет транзакции"; String get settings_fee_priority => "Приоритет транзакции";
@override @override
String get rename => "Переименовать";
@override
String get restore_active_seed => "Активная мнемоническая фраза"; String get restore_active_seed => "Активная мнемоническая фраза";
@override @override
String get settings_personal => "Персональные"; String get settings_personal => "Персональные";
@ -1880,6 +1906,8 @@ class $ru extends S {
@override @override
String get spend_key_private => "Приватный ключ траты"; String get spend_key_private => "Приватный ключ траты";
@override @override
String get choose_account => "Выберите аккаунт";
@override
String get settings_only_trades => "Сделки"; String get settings_only_trades => "Сделки";
@override @override
String get trade_state_to_be_created => "Будет создана"; String get trade_state_to_be_created => "Будет создана";
@ -2200,6 +2228,8 @@ class $ko extends S {
@override @override
String get trade_details_fetching => "가져 오는 중"; String get trade_details_fetching => "가져 오는 중";
@override @override
String get create_new_account => "새 계정을 만들";
@override
String get buy => "구입"; String get buy => "구입";
@override @override
String get confirm_sending => "전송 확인"; String get confirm_sending => "전송 확인";
@ -2350,6 +2380,8 @@ class $ko extends S {
@override @override
String get change_language => "언어 변경"; String get change_language => "언어 변경";
@override @override
String get accounts_subaddresses => "계정 및 하위 주소";
@override
String get wallet_name => "지갑 이름"; String get wallet_name => "지갑 이름";
@override @override
String get error_text_payment_id => "지불 ID는 16 ~ 64 자의 16 진 문자 만 포함 할 수 있습니다"; String get error_text_payment_id => "지불 ID는 16 ~ 64 자의 16 진 문자 만 포함 할 수 있습니다";
@ -2438,6 +2470,8 @@ class $ko extends S {
@override @override
String get settings_fee_priority => "수수료 우선"; String get settings_fee_priority => "수수료 우선";
@override @override
String get rename => "이름 바꾸기";
@override
String get restore_active_seed => "활성 종자"; String get restore_active_seed => "활성 종자";
@override @override
String get settings_personal => "개인적인"; String get settings_personal => "개인적인";
@ -2464,6 +2498,8 @@ class $ko extends S {
@override @override
String get spend_key_private => "지출 키 (은밀한)"; String get spend_key_private => "지출 키 (은밀한)";
@override @override
String get choose_account => "계정을 선택하십시오";
@override
String get settings_only_trades => "거래 만"; String get settings_only_trades => "거래 만";
@override @override
String get trade_state_to_be_created => "만들려면"; String get trade_state_to_be_created => "만들려면";
@ -2784,6 +2820,8 @@ class $pt extends S {
@override @override
String get trade_details_fetching => "Buscando"; String get trade_details_fetching => "Buscando";
@override @override
String get create_new_account => "Criar nova conta";
@override
String get buy => "Comprar"; String get buy => "Comprar";
@override @override
String get confirm_sending => "Confirmar o envio"; String get confirm_sending => "Confirmar o envio";
@ -2934,6 +2972,8 @@ class $pt extends S {
@override @override
String get change_language => "Mudar idioma"; String get change_language => "Mudar idioma";
@override @override
String get accounts_subaddresses => "Contas e sub-endereços";
@override
String get wallet_name => "Nome da carteira"; String get wallet_name => "Nome da carteira";
@override @override
String get error_text_payment_id => "O ID de pagamento pode conter apenas de 16 a 64 caracteres em hexadecimal"; String get error_text_payment_id => "O ID de pagamento pode conter apenas de 16 a 64 caracteres em hexadecimal";
@ -3022,6 +3062,8 @@ class $pt extends S {
@override @override
String get settings_fee_priority => "Prioridade da taxa"; String get settings_fee_priority => "Prioridade da taxa";
@override @override
String get rename => "Renomear";
@override
String get restore_active_seed => "Semente ativa"; String get restore_active_seed => "Semente ativa";
@override @override
String get settings_personal => "Pessoal"; String get settings_personal => "Pessoal";
@ -3048,6 +3090,8 @@ class $pt extends S {
@override @override
String get spend_key_private => "Chave de gastos (privada)"; String get spend_key_private => "Chave de gastos (privada)";
@override @override
String get choose_account => "Escolha uma conta";
@override
String get settings_only_trades => "Somente trocas"; String get settings_only_trades => "Somente trocas";
@override @override
String get trade_state_to_be_created => "A ser criada"; String get trade_state_to_be_created => "A ser criada";
@ -3298,7 +3342,7 @@ class $uk extends S {
@override @override
String get transaction_details_recipient_address => "Адреса отримувача"; String get transaction_details_recipient_address => "Адреса отримувача";
@override @override
String get receive_amount => "Баланс"; String get receive_amount => "Сума";
@override @override
String get settings_allow_biometrical_authentication => "Включити біометричну аутентифікацію"; String get settings_allow_biometrical_authentication => "Включити біометричну аутентифікацію";
@override @override
@ -3368,6 +3412,8 @@ class $uk extends S {
@override @override
String get trade_details_fetching => "Отримання"; String get trade_details_fetching => "Отримання";
@override @override
String get create_new_account => "Створити новий акаунт";
@override
String get buy => "Купити"; String get buy => "Купити";
@override @override
String get confirm_sending => "Підтвердити відправлення"; String get confirm_sending => "Підтвердити відправлення";
@ -3518,6 +3564,8 @@ class $uk extends S {
@override @override
String get change_language => "Змінити мову"; String get change_language => "Змінити мову";
@override @override
String get accounts_subaddresses => "Акаунти та субадреси";
@override
String get wallet_name => "Ім'я гаманця"; String get wallet_name => "Ім'я гаманця";
@override @override
String get error_text_payment_id => "Ідентифікатор платежу може містити від 16 до 64 символів в hex"; String get error_text_payment_id => "Ідентифікатор платежу може містити від 16 до 64 символів в hex";
@ -3606,6 +3654,8 @@ class $uk extends S {
@override @override
String get settings_fee_priority => "Пріоритет транзакції"; String get settings_fee_priority => "Пріоритет транзакції";
@override @override
String get rename => "Перейменувати";
@override
String get restore_active_seed => "Активна мнемонічна фраза"; String get restore_active_seed => "Активна мнемонічна фраза";
@override @override
String get settings_personal => "Персональні"; String get settings_personal => "Персональні";
@ -3632,6 +3682,8 @@ class $uk extends S {
@override @override
String get spend_key_private => "Приватний ключ витрати"; String get spend_key_private => "Приватний ключ витрати";
@override @override
String get choose_account => "Оберіть акаунт";
@override
String get settings_only_trades => "Операції"; String get settings_only_trades => "Операції";
@override @override
String get trade_state_to_be_created => "Буде створена"; String get trade_state_to_be_created => "Буде створена";
@ -3952,6 +4004,8 @@ class $ja extends S {
@override @override
String get trade_details_fetching => "フェッチング"; String get trade_details_fetching => "フェッチング";
@override @override
String get create_new_account => "新しいアカウントを作成する";
@override
String get buy => "購入"; String get buy => "購入";
@override @override
String get confirm_sending => "送信を確認"; String get confirm_sending => "送信を確認";
@ -4102,6 +4156,8 @@ class $ja extends S {
@override @override
String get change_language => "言語を変えてください"; String get change_language => "言語を変えてください";
@override @override
String get accounts_subaddresses => "アカウントとサブアドレス";
@override
String get wallet_name => "ウォレット名"; String get wallet_name => "ウォレット名";
@override @override
String get error_text_payment_id => "支払いIDには、16進数で16〜64文字しか含めることができません"; String get error_text_payment_id => "支払いIDには、16進数で16〜64文字しか含めることができません";
@ -4190,6 +4246,8 @@ class $ja extends S {
@override @override
String get settings_fee_priority => "料金優先"; String get settings_fee_priority => "料金優先";
@override @override
String get rename => "リネーム";
@override
String get restore_active_seed => "アクティブシード"; String get restore_active_seed => "アクティブシード";
@override @override
String get settings_personal => "パーソナル"; String get settings_personal => "パーソナル";
@ -4216,6 +4274,8 @@ class $ja extends S {
@override @override
String get spend_key_private => "キーを使う (プライベート)"; String get spend_key_private => "キーを使う (プライベート)";
@override @override
String get choose_account => "アカウントを選択";
@override
String get settings_only_trades => "取引のみ"; String get settings_only_trades => "取引のみ";
@override @override
String get trade_state_to_be_created => "作成される"; String get trade_state_to_be_created => "作成される";
@ -4540,6 +4600,8 @@ class $pl extends S {
@override @override
String get trade_details_fetching => "Ujmujący"; String get trade_details_fetching => "Ujmujący";
@override @override
String get create_new_account => "Stwórz nowe konto";
@override
String get buy => "Kup"; String get buy => "Kup";
@override @override
String get confirm_sending => "Potwierdź wysłanie"; String get confirm_sending => "Potwierdź wysłanie";
@ -4690,6 +4752,8 @@ class $pl extends S {
@override @override
String get change_language => "Zmień język"; String get change_language => "Zmień język";
@override @override
String get accounts_subaddresses => "Konta i podadresy";
@override
String get wallet_name => "Nazwa portfela"; String get wallet_name => "Nazwa portfela";
@override @override
String get error_text_payment_id => "ID może zawierać od 16 do 64 znaków w formacie szesnastkowym"; String get error_text_payment_id => "ID może zawierać od 16 do 64 znaków w formacie szesnastkowym";
@ -4778,6 +4842,8 @@ class $pl extends S {
@override @override
String get settings_fee_priority => "Priorytet opłaty"; String get settings_fee_priority => "Priorytet opłaty";
@override @override
String get rename => "Przemianować";
@override
String get restore_active_seed => "Aktywne nasiona"; String get restore_active_seed => "Aktywne nasiona";
@override @override
String get settings_personal => "Osobisty"; String get settings_personal => "Osobisty";
@ -4804,6 +4870,8 @@ class $pl extends S {
@override @override
String get spend_key_private => "Wydaj klucz (prywatny)"; String get spend_key_private => "Wydaj klucz (prywatny)";
@override @override
String get choose_account => "Wybierz konto";
@override
String get settings_only_trades => "Tylko transakcje"; String get settings_only_trades => "Tylko transakcje";
@override @override
String get trade_state_to_be_created => "Zostać stworzonym"; String get trade_state_to_be_created => "Zostać stworzonym";
@ -5124,6 +5192,8 @@ class $es extends S {
@override @override
String get trade_details_fetching => "Cargando"; String get trade_details_fetching => "Cargando";
@override @override
String get create_new_account => "Crear una nueva cuenta";
@override
String get buy => "Comprar"; String get buy => "Comprar";
@override @override
String get confirm_sending => "Confirmar envío"; String get confirm_sending => "Confirmar envío";
@ -5274,6 +5344,8 @@ class $es extends S {
@override @override
String get change_language => "Cambiar idioma"; String get change_language => "Cambiar idioma";
@override @override
String get accounts_subaddresses => "Cuentas y subdirecciones";
@override
String get wallet_name => "Nombre de la billetera"; String get wallet_name => "Nombre de la billetera";
@override @override
String get error_text_payment_id => "La ID de pago solo puede contener de 16 a 64 caracteres en hexadecimal"; String get error_text_payment_id => "La ID de pago solo puede contener de 16 a 64 caracteres en hexadecimal";
@ -5362,6 +5434,8 @@ class $es extends S {
@override @override
String get settings_fee_priority => "Prioridad de tasa"; String get settings_fee_priority => "Prioridad de tasa";
@override @override
String get rename => "Rebautizar";
@override
String get restore_active_seed => "Semilla activa"; String get restore_active_seed => "Semilla activa";
@override @override
String get settings_personal => "Personal"; String get settings_personal => "Personal";
@ -5388,6 +5462,8 @@ class $es extends S {
@override @override
String get spend_key_private => "Spend clave (privado)"; String get spend_key_private => "Spend clave (privado)";
@override @override
String get choose_account => "Elegir cuenta";
@override
String get settings_only_trades => "Solo comercia"; String get settings_only_trades => "Solo comercia";
@override @override
String get trade_state_to_be_created => "Ser creado"; String get trade_state_to_be_created => "Ser creado";
@ -5708,6 +5784,8 @@ class $nl extends S {
@override @override
String get trade_details_fetching => "Ophalen"; String get trade_details_fetching => "Ophalen";
@override @override
String get create_new_account => "Creëer een nieuw account";
@override
String get buy => "Kopen"; String get buy => "Kopen";
@override @override
String get confirm_sending => "Bevestig verzending"; String get confirm_sending => "Bevestig verzending";
@ -5858,6 +5936,8 @@ class $nl extends S {
@override @override
String get change_language => "Verander de taal"; String get change_language => "Verander de taal";
@override @override
String get accounts_subaddresses => "Accounts en subadressen";
@override
String get wallet_name => "Portemonnee naam"; String get wallet_name => "Portemonnee naam";
@override @override
String get error_text_payment_id => "Betalings-ID kan alleen 16 tot 64 tekens bevatten in hexadecimale volgorde"; String get error_text_payment_id => "Betalings-ID kan alleen 16 tot 64 tekens bevatten in hexadecimale volgorde";
@ -5946,6 +6026,8 @@ class $nl extends S {
@override @override
String get settings_fee_priority => "Tariefprioriteit"; String get settings_fee_priority => "Tariefprioriteit";
@override @override
String get rename => "Hernoemen";
@override
String get restore_active_seed => "Actief zaad"; String get restore_active_seed => "Actief zaad";
@override @override
String get settings_personal => "Persoonlijk"; String get settings_personal => "Persoonlijk";
@ -5972,6 +6054,8 @@ class $nl extends S {
@override @override
String get spend_key_private => "Sleutel uitgeven (privaat)"; String get spend_key_private => "Sleutel uitgeven (privaat)";
@override @override
String get choose_account => "Kies account";
@override
String get settings_only_trades => "Alleen handel"; String get settings_only_trades => "Alleen handel";
@override @override
String get trade_state_to_be_created => "Om gecreëerd te worden"; String get trade_state_to_be_created => "Om gecreëerd te worden";
@ -6292,6 +6376,8 @@ class $zh extends S {
@override @override
String get trade_details_fetching => "正在取得"; String get trade_details_fetching => "正在取得";
@override @override
String get create_new_account => "建立新帳戶";
@override
String get buy => "購買"; String get buy => "購買";
@override @override
String get confirm_sending => "确认发送"; String get confirm_sending => "确认发送";
@ -6442,6 +6528,8 @@ class $zh extends S {
@override @override
String get change_language => "改變語言"; String get change_language => "改變語言";
@override @override
String get accounts_subaddresses => "帳戶和子地址";
@override
String get wallet_name => "钱包名称"; String get wallet_name => "钱包名称";
@override @override
String get error_text_payment_id => "付款ID只能包含16到64个字符十六进制"; String get error_text_payment_id => "付款ID只能包含16到64个字符十六进制";
@ -6530,6 +6618,8 @@ class $zh extends S {
@override @override
String get settings_fee_priority => "费用优先"; String get settings_fee_priority => "费用优先";
@override @override
String get rename => "改名";
@override
String get restore_active_seed => "活性種子"; String get restore_active_seed => "活性種子";
@override @override
String get settings_personal => "个人"; String get settings_personal => "个人";
@ -6556,6 +6646,8 @@ class $zh extends S {
@override @override
String get spend_key_private => "支出金钥 (私人的)"; String get spend_key_private => "支出金钥 (私人的)";
@override @override
String get choose_account => "選擇帳號";
@override
String get settings_only_trades => "只交易"; String get settings_only_trades => "只交易";
@override @override
String get trade_state_to_be_created => "待创建"; String get trade_state_to_be_created => "待创建";

View file

@ -68,7 +68,6 @@ import 'package:cake_wallet/src/screens/disclaimer/disclaimer_page.dart';
import 'package:cake_wallet/src/screens/seed_language/seed_language_page.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/transaction_details/transaction_details_page.dart';
import 'package:cake_wallet/src/screens/accounts/account_page.dart'; import 'package:cake_wallet/src/screens/accounts/account_page.dart';
import 'package:cake_wallet/src/screens/accounts/account_list_page.dart';
import 'package:cake_wallet/src/screens/address_book/address_book_page.dart'; import 'package:cake_wallet/src/screens/address_book/address_book_page.dart';
import 'package:cake_wallet/src/screens/address_book/contact_page.dart'; import 'package:cake_wallet/src/screens/address_book/contact_page.dart';
import 'package:cake_wallet/src/screens/show_keys/show_keys_page.dart'; import 'package:cake_wallet/src/screens/show_keys/show_keys_page.dart';
@ -242,7 +241,10 @@ class Router {
builder: (_) => MultiProvider(providers: [ builder: (_) => MultiProvider(providers: [
Provider( Provider(
create: (_) => create: (_) =>
SubaddressListStore(walletService: walletService)) SubaddressListStore(walletService: walletService)),
Provider(
create: (_) =>
AccountListStore(walletService: walletService))
], child: ReceivePage())); ], child: ReceivePage()));
case Routes.transactionDetails: case Routes.transactionDetails:
@ -256,7 +258,7 @@ class Router {
builder: (_) => Provider( builder: (_) => Provider(
create: (_) => create: (_) =>
SubadrressCreationStore(walletService: walletService), SubadrressCreationStore(walletService: walletService),
child: NewSubaddressPage())); child: NewSubaddressPage(subaddress: settings.arguments as Subaddress,)));
case Routes.disclaimer: case Routes.disclaimer:
return CupertinoPageRoute<void>(builder: (_) => DisclaimerPage()); return CupertinoPageRoute<void>(builder: (_) => DisclaimerPage());
@ -325,17 +327,6 @@ class Router {
authenticationStore: authenticationStore); authenticationStore: authenticationStore);
}); });
case Routes.accountList:
return MaterialPageRoute<void>(
builder: (context) {
return MultiProvider(providers: [
Provider(
create: (_) =>
AccountListStore(walletService: walletService)),
], child: AccountListPage());
},
fullscreenDialog: true);
case Routes.accountCreation: case Routes.accountCreation:
return CupertinoPageRoute<String>(builder: (context) { return CupertinoPageRoute<String>(builder: (context) {
return Provider( return Provider(

View file

@ -25,7 +25,6 @@ class Routes {
static const newNode = '/new_node_list'; static const newNode = '/new_node_list';
static const login = '/login'; static const login = '/login';
static const splash = '/splash'; static const splash = '/splash';
static const accountList = '/account_list';
static const accountCreation = '/account_new'; static const accountCreation = '/account_new';
static const addressBook = '/address_book'; static const addressBook = '/address_book';
static const pickerAddressBook = '/picker_address_book'; static const pickerAddressBook = '/picker_address_book';

View file

@ -50,7 +50,7 @@ class SubaddressList {
{int accountIndex, int addressIndex, String label}) async { {int accountIndex, int addressIndex, String label}) async {
await subaddress_list.setLabelForSubaddress( await subaddress_list.setLabelForSubaddress(
accountIndex: accountIndex, addressIndex: addressIndex, label: label); accountIndex: accountIndex, addressIndex: addressIndex, label: label);
await update(); await update(accountIndex: accountIndex);
} }
Future refresh({int accountIndex}) async { Future refresh({int accountIndex}) async {

View file

@ -1,120 +1,153 @@
import 'dart:ui';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/stores/account_list/account_list_store.dart'; import 'package:cake_wallet/src/stores/account_list/account_list_store.dart';
import 'package:cake_wallet/src/screens/accounts/widgets/account_tile.dart';
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart'; import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
class AccountListPage extends BasePage { class AccountListPage extends StatefulWidget {
@override AccountListPage({@required this.accountListStore});
String get title => S.current.accounts;
final AccountListStore accountListStore;
@override @override
Widget trailing(BuildContext context) { AccountListPageForm createState() => AccountListPageForm(accountListStore);
final accountListStore = Provider.of<AccountListStore>(context); }
return Container( class AccountListPageForm extends State<AccountListPage> {
width: 28.0, AccountListPageForm(this.accountListStore);
height: 28.0,
decoration: BoxDecoration( final AccountListStore accountListStore;
shape: BoxShape.circle, color: Theme.of(context).selectedRowColor),
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Icon(Icons.add, color: Palette.violet, size: 22.0),
ButtonTheme(
minWidth: 28.0,
height: 28.0,
child: FlatButton(
shape: CircleBorder(),
onPressed: () async {
await Navigator.of(context)
.pushNamed(Routes.accountCreation);
accountListStore.updateAccountList();
},
child: Offstage()),
)
],
));
}
@override @override
Widget body(BuildContext context) { Widget build(BuildContext context) {
final accountListStore = Provider.of<AccountListStore>(context);
final walletStore = Provider.of<WalletStore>(context); final walletStore = Provider.of<WalletStore>(context);
final currentColor = Theme.of(context).selectedRowColor; return GestureDetector(
final notCurrentColor = Theme.of(context).backgroundColor; onTap: () => Navigator.of(context).pop(),
child: Container(
return Container( color: Colors.transparent,
padding: EdgeInsets.only(top: 10, bottom: 20), child: BackdropFilter(
child: Observer(builder: (_) { filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
final accounts = accountListStore.accounts; child: Container(
return ListView.builder( decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)),
itemCount: accounts == null ? 0 : accounts.length, child: Center(
itemBuilder: (BuildContext context, int index) { child: Column(
final account = accounts[index]; mainAxisSize: MainAxisSize.min,
children: <Widget>[
return Observer(builder: (_) { Container(
final isCurrent = walletStore.account.id == account.id; padding: EdgeInsets.only(left: 24, right: 24),
child: Text(
return Slidable( S.of(context).choose_account,
key: Key(account.id.toString()), textAlign: TextAlign.center,
actionPane: SlidableDrawerActionPane(), style: TextStyle(
child: Container( fontSize: 18,
color: isCurrent ? currentColor : notCurrentColor, fontWeight: FontWeight.bold,
child: Column( decoration: TextDecoration.none,
children: <Widget>[ color: Colors.white
ListTile( ),
title: Text(
account.label,
style: TextStyle(
fontSize: 16.0,
color: Theme.of(context)
.primaryTextTheme
.headline
.color),
),
onTap: () {
if (isCurrent) {
return;
}
walletStore.setAccount(account);
Navigator.of(context).pop();
},
),
Divider(
color: Theme.of(context).dividerTheme.color,
height: 1.0,
)
],
), ),
), ),
secondaryActions: <Widget>[ Padding(
IconSlideAction( padding: EdgeInsets.only(left: 24, right: 24, top: 24),
caption: S.of(context).edit, child: GestureDetector(
color: Colors.blue, onTap: () => null,
icon: Icons.edit, child: ClipRRect(
onTap: () async { borderRadius: BorderRadius.all(Radius.circular(14)),
await Navigator.of(context).pushNamed( child: Container(
Routes.accountCreation, height: 296,
arguments: account); color: PaletteDark.menuList,
// await accountListStore.updateAccountList().then((_) { child: Column(
// if (isCurrent) walletStore.setAccount(accountListStore.accounts[index]); children: <Widget>[
// }); Expanded(
}, child: Observer(
) builder: (_) {
], final accounts = accountListStore.accounts;
);
}); return ListView.separated(
}); separatorBuilder: (context, index) => Divider(
}), color: PaletteDark.mainBackgroundColor,
height: 1,
),
itemCount: accounts == null ? 0 : accounts.length,
itemBuilder: (context, index) {
final account = accounts[index];
return Observer(
builder: (_) {
final isCurrent = walletStore.account.id == account.id;
return AccountTile(
isCurrent: isCurrent,
accountName: account.label,
onTap: () {
if (isCurrent) {
return;
}
walletStore.setAccount(account);
Navigator.of(context).pop();
}
);
}
);
},
);
}
)
),
GestureDetector(
onTap: () async {
await Navigator.of(context)
.pushNamed(Routes.accountCreation);
accountListStore.updateAccountList();
},
child: Container(
height: 62,
color: Colors.white,
padding: EdgeInsets.only(left: 24, right: 24),
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.add,
color: PaletteDark.historyPanel,
),
Padding(
padding: EdgeInsets.only(left: 5),
child: Text(
S.of(context).create_new_account,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: PaletteDark.historyPanel,
decoration: TextDecoration.none,
),
),
)
],
),
),
),
)
],
),
),
),
),
)
],
),
),
),
),
),
); );
} }
} }

View file

@ -8,6 +8,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/domain/monero/account.dart'; import 'package:cake_wallet/src/domain/monero/account.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
class AccountPage extends BasePage { class AccountPage extends BasePage {
AccountPage({this.account}); AccountPage({this.account});
@ -15,7 +16,10 @@ class AccountPage extends BasePage {
final Account account; final Account account;
@override @override
String get title => 'Account'; String get title => S.current.account;
@override
Color get backgroundColor => PaletteDark.historyPanel;
@override @override
Widget body(BuildContext context) => AccountForm(account); Widget body(BuildContext context) => AccountForm(account);
@ -50,30 +54,31 @@ class AccountFormState extends State<AccountForm> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final accountListStore = Provider.of<AccountListStore>(context); final accountListStore = Provider.of<AccountListStore>(context);
_textController.addListener(() {
if (_textController.text.isNotEmpty) {
accountListStore.setDisabledStatus(false);
} else {
accountListStore.setDisabledStatus(true);
}
});
return Form( return Form(
key: _formKey, key: _formKey,
child: Container( child: Container(
padding: EdgeInsets.all(20.0), color: PaletteDark.historyPanel,
padding: EdgeInsets.all(24.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Center( child: Center(
child: TextFormField( child: BaseTextFormField(
decoration: InputDecoration( controller: _textController,
hintStyle: TextStyle(color: Theme.of(context).hintColor),
hintText: S.of(context).account, hintText: S.of(context).account,
focusedBorder: UnderlineInputBorder( validator: (value) {
borderSide: accountListStore.validateAccountName(value);
BorderSide(color: Palette.cakeGreen, width: 2.0)), return accountListStore.errorMessage;
enabledBorder: UnderlineInputBorder( },
borderSide: BorderSide( )
color: Theme.of(context).focusColor, width: 1.0))),
controller: _textController,
validator: (value) {
accountListStore.validateAccountName(value);
return accountListStore.errorMessage;
},
),
)), )),
Observer( Observer(
builder: (_) => LoadingPrimaryButton( builder: (_) => LoadingPrimaryButton(
@ -93,13 +98,11 @@ class AccountFormState extends State<AccountForm> {
Navigator.of(context).pop(_textController.text); Navigator.of(context).pop(_textController.text);
}, },
text: text:
widget.account != null ? 'Rename' : S.of(context).add, widget.account != null ? S.of(context).rename : S.of(context).add,
color: Theme.of(context) color: Colors.green,
.primaryTextTheme textColor: Colors.white,
.button
.backgroundColor,
textColor: Theme.of(context).primaryTextTheme.button.color,
isLoading: accountListStore.isAccountCreating, isLoading: accountListStore.isAccountCreating,
isDisabled: accountListStore.isDisabledStatus,
)) ))
], ],
), ),

View file

@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
class AccountTile extends StatelessWidget {
AccountTile({
@required this.isCurrent,
@required this.accountName,
@required this.onTap
});
final bool isCurrent;
final String accountName;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
final color = isCurrent ? PaletteDark.menuHeader : Colors.transparent;
final textColor = isCurrent ? Colors.blue : Colors.white;
return GestureDetector(
onTap: onTap,
child: Container(
height: 77,
padding: EdgeInsets.only(left: 24, right: 24),
alignment: Alignment.centerLeft,
color: color,
child: Text(
accountName,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: textColor,
decoration: TextDecoration.none,
),
),
),
);
}
}

View file

@ -12,7 +12,8 @@ import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/domain/common/sync_status.dart'; import 'package:cake_wallet/src/domain/common/sync_status.dart';
import 'package:cake_wallet/src/screens/receive/qr_image.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
import 'package:cake_wallet/routes.dart';
class WalletCard extends StatefulWidget { class WalletCard extends StatefulWidget {
@override @override
@ -425,12 +426,14 @@ class WalletCardState extends State<WalletCard> {
color: PaletteDark.walletCardSubAddressField color: PaletteDark.walletCardSubAddressField
), ),
child: InkWell( child: InkWell(
onTap: () {}, onTap: () => Navigator.of(context,
rootNavigator: true)
.pushNamed(Routes.receive),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text( Text(
S.current.subaddresses, S.of(context).accounts_subaddresses,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Colors.white color: Colors.white

View file

@ -13,7 +13,7 @@ import 'package:cake_wallet/src/stores/send/send_store.dart';
import 'package:cake_wallet/src/stores/send/sending_state.dart'; import 'package:cake_wallet/src/stores/send/sending_state.dart';
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart'; import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
import 'package:cake_wallet/src/screens/exchange_trade/widgets/copy_button.dart'; import 'package:cake_wallet/src/screens/exchange_trade/widgets/copy_button.dart';
import 'package:cake_wallet/src/screens/receive/qr_image.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/exchange_trade/widgets/timer_widget.dart'; import 'package:cake_wallet/src/screens/exchange_trade/widgets/timer_widget.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart';

View file

@ -3,18 +3,26 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:esys_flutter_share/esys_flutter_share.dart'; import 'package:esys_flutter_share/esys_flutter_share.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/stores/subaddress_list/subaddress_list_store.dart'; import 'package:cake_wallet/src/stores/subaddress_list/subaddress_list_store.dart';
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart'; import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
import 'package:cake_wallet/src/screens/receive/qr_image.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/accounts/account_list_page.dart';
import 'package:cake_wallet/src/stores/account_list/account_list_store.dart';
import 'package:cake_wallet/src/screens/receive/widgets/header_tile.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
class ReceivePage extends BasePage { class ReceivePage extends BasePage {
@override @override
bool get isModalBackButton => true; Color get backgroundColor => PaletteDark.mainBackgroundColor;
@override
bool get resizeToAvoidBottomPadding => false;
@override @override
String get title => S.current.receive; String get title => S.current.receive;
@ -22,6 +30,7 @@ class ReceivePage extends BasePage {
@override @override
Widget trailing(BuildContext context) { Widget trailing(BuildContext context) {
final walletStore = Provider.of<WalletStore>(context); final walletStore = Provider.of<WalletStore>(context);
final shareImage = Image.asset('assets/images/share.png');
return SizedBox( return SizedBox(
height: 37.0, height: 37.0,
@ -33,18 +42,14 @@ class ReceivePage extends BasePage {
splashColor: Colors.transparent, splashColor: Colors.transparent,
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
onPressed: () => Share.text( onPressed: () => Share.text(
'Share address', walletStore.subaddress.address, 'text/plain'), S.current.share_address, walletStore.subaddress.address, 'text/plain'),
child: Icon( child: shareImage),
Icons.share,
size: 30.0,
)),
), ),
); );
} }
@override @override
Widget body(BuildContext context) => Widget body(BuildContext context) => ReceiveBody();
SingleChildScrollView(child: ReceiveBody());
} }
class ReceiveBody extends StatefulWidget { class ReceiveBody extends StatefulWidget {
@ -66,9 +71,15 @@ class ReceiveBodyState extends State<ReceiveBody> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final walletStore = Provider.of<WalletStore>(context); final walletStore = Provider.of<WalletStore>(context);
final subaddressListStore = Provider.of<SubaddressListStore>(context); final subaddressListStore = Provider.of<SubaddressListStore>(context);
final accountListStore = Provider.of<AccountListStore>(context);
final currentColor = Theme.of(context).selectedRowColor; final copyImage = Image.asset('assets/images/copy_content.png');
final notCurrentColor = Theme.of(context).scaffoldBackgroundColor;
final currentColor = PaletteDark.menuList;
final notCurrentColor = PaletteDark.historyPanel;
final currentTextColor = Colors.blue;
final notCurrentTextColor = PaletteDark.walletCardText;
amountController.addListener(() { amountController.addListener(() {
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
@ -78,202 +89,227 @@ class ReceiveBodyState extends State<ReceiveBody> {
} }
}); });
return SafeArea( return Container(
child: SingleChildScrollView( height: MediaQuery.of(context).size.height,
child: Column( width: MediaQuery.of(context).size.width,
children: <Widget>[ color: PaletteDark.mainBackgroundColor,
Container( padding: EdgeInsets.only(top: 24),
padding: EdgeInsets.all(35.0), child: SingleChildScrollView(
color: Theme.of(context).backgroundColor, child: Column(
child: Column( children: <Widget>[
children: <Widget>[ Observer(builder: (_) {
Observer(builder: (_) { return Row(
return Row( children: <Widget>[
children: <Widget>[ Spacer(
Spacer( flex: 1,
flex: 1, ),
), Flexible(
Flexible( flex: 2,
flex: 2, child: Center(
child: AspectRatio( child: AspectRatio(
aspectRatio: 1.0, aspectRatio: 1.0,
child: Container( child: QrImage(
padding: EdgeInsets.all(5), data: walletStore.subaddress.address +
color: Colors.white, walletStore.amountValue,
child: QrImage( backgroundColor: Colors.transparent,
data: walletStore.subaddress.address + foregroundColor: PaletteDark.walletCardText,
walletStore.amountValue,
backgroundColor: Colors.transparent,
),
),
)),
Spacer(
flex: 1,
)
],
);
}),
Observer(builder: (_) {
return Row(
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.all(20.0),
child: Center(
child: GestureDetector(
onTap: () {
Clipboard.setData(ClipboardData(
text: walletStore.subaddress.address));
Scaffold.of(context).showSnackBar(SnackBar(
content: Text(
S.of(context).copied_to_clipboard,
style: TextStyle(color: Colors.white),
),
backgroundColor: Colors.green,
));
},
child: Text(
walletStore.subaddress.address,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.title
.color),
), ),
), ),
), )),
)) Spacer(
], flex: 1,
); )
}), ],
Row( );
}),
Padding(
padding: EdgeInsets.all(24),
child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Form( child: Form(
key: _formKey, key: _formKey,
child: TextFormField( child: BaseTextFormField(
keyboardType: controller: amountController,
TextInputType.numberWithOptions(decimal: true), keyboardType: TextInputType.numberWithOptions(decimal: true),
inputFormatters: [ inputFormatters: [
BlacklistingTextInputFormatter( BlacklistingTextInputFormatter(
RegExp('[\\-|\\ |\\,]')) RegExp('[\\-|\\ |\\,]'))
], ],
style: TextStyle( textAlign: TextAlign.center,
fontSize: 14.0, hintText: S.of(context).receive_amount,
), borderColor: PaletteDark.walletCardText,
decoration: InputDecoration(
hintStyle: TextStyle(
color: Theme.of(context).hintColor),
hintText: S.of(context).amount,
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Palette.cakeGreen, width: 2.0)),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).focusColor,
width: 1.0))),
validator: (value) { validator: (value) {
walletStore.validateAmount(value); walletStore.validateAmount(value);
return walletStore.errorMessage; return walletStore.errorMessage;
}, },
autovalidate: true, autovalidate: true,
controller: amountController, )
))) )
],
)
],
),
),
Row(
children: <Widget>[
Expanded(
child: Container(
color: Theme.of(context).accentTextTheme.headline.color,
child: Column(
children: <Widget>[
ListTile(
title: Text(
S.of(context).subaddresses,
style: TextStyle(
fontSize: 16.0,
color: Theme.of(context)
.primaryTextTheme
.headline
.color),
),
trailing: Container(
width: 28.0,
height: 28.0,
decoration: BoxDecoration(
color: Theme.of(context).selectedRowColor,
shape: BoxShape.circle),
child: InkWell(
onTap: () => Navigator.of(context)
.pushNamed(Routes.newSubaddress),
borderRadius: BorderRadius.all(Radius.circular(14.0)),
child: Icon(
Icons.add,
color: Palette.violet,
size: 22.0,
),
),
),
),
Divider(
color: Theme.of(context).dividerTheme.color,
height: 1.0,
) )
], ],
), ),
)) ),
Padding(
padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
child: Observer(
builder: (_) => GestureDetector(
onTap: () {
Clipboard.setData(ClipboardData(
text: walletStore.subaddress.address));
Scaffold.of(context).showSnackBar(SnackBar(
content: Text(
S.of(context).copied_to_clipboard,
style: TextStyle(color: Colors.white),
),
backgroundColor: Colors.green,
duration: Duration(milliseconds: 500),
));
},
child: Container(
height: 48,
padding: EdgeInsets.only(left: 24, right: 24),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(27)),
color: PaletteDark.walletCardSubAddressField
),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
child: Text(
walletStore.subaddress.address,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Colors.white
),
),
),
Padding(
padding: EdgeInsets.only(left: 12),
child: copyImage,
)
],
),
),
)
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(24),
topRight: Radius.circular(24),
),
color: PaletteDark.historyPanel,
),
child: Observer(
builder: (_) => ListView.separated(
separatorBuilder: (context, index) => Divider(
height: 1,
color: PaletteDark.menuList,
),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: subaddressListStore.subaddresses.length + 2,
itemBuilder: (context, index) {
if (index == 0) {
return HeaderTile(
onTap: () async {
await showDialog<void>(
context: context,
builder: (BuildContext context) {
return AccountListPage(accountListStore: accountListStore);
}
);
},
title: walletStore.account.label,
icon: Icon(
Icons.arrow_forward_ios,
size: 14,
color: Colors.white,
)
);
}
if (index == 1) {
return HeaderTile(
onTap: () => Navigator.of(context)
.pushNamed(Routes.newSubaddress),
title: S.of(context).subaddresses,
icon: Icon(
Icons.add,
size: 20,
color: Colors.white,
)
);
}
index -= 2;
return Observer(
builder: (_) {
final subaddress = subaddressListStore.subaddresses[index];
final isCurrent =
walletStore.subaddress.address == subaddress.address;
final label = subaddress.label.isNotEmpty
? subaddress.label
: subaddress.address;
final content = InkWell(
onTap: () => walletStore.setSubaddress(subaddress),
child: Container(
color: isCurrent ? currentColor : notCurrentColor,
padding: EdgeInsets.only(
left: 24,
right: 24,
top: 28,
bottom: 28
),
child: Text(
label,
style: TextStyle(
fontSize: subaddress.label.isNotEmpty
? 18 : 10,
fontWeight: FontWeight.bold,
color: isCurrent
? currentTextColor
: notCurrentTextColor,
),
),
),
);
return isCurrent
? content
: Slidable(
key: Key(subaddress.address),
actionPane: SlidableDrawerActionPane(),
child: content,
secondaryActions: <Widget>[
IconSlideAction(
caption: S.of(context).edit,
color: PaletteDark.walletCardSubAddressField,
icon: Icons.edit,
onTap: () => Navigator.of(context)
.pushNamed(Routes.newSubaddress, arguments: subaddress),
)
]
);
}
);
}
)
),
),
], ],
), ),
Observer(builder: (_) { )
return ListView.separated( );
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: subaddressListStore.subaddresses.length,
separatorBuilder: (context, i) {
return Divider(
color: Theme.of(context).dividerTheme.color,
height: 1.0,
);
},
itemBuilder: (context, i) {
return Observer(builder: (_) {
final subaddress = subaddressListStore.subaddresses[i];
final isCurrent =
walletStore.subaddress.address == subaddress.address;
final label = subaddress.label.isNotEmpty
? subaddress.label
: subaddress.address;
return InkWell(
onTap: () => walletStore.setSubaddress(subaddress),
child: Container(
color: isCurrent ? currentColor : notCurrentColor,
child: Column(children: <Widget>[
ListTile(
title: Text(
label,
style: TextStyle(
fontSize: 16.0,
color: Theme.of(context)
.primaryTextTheme
.headline
.color),
),
)
]),
),
);
});
});
})
],
)));
} }
} }

View file

@ -0,0 +1,53 @@
import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
class HeaderTile extends StatelessWidget {
HeaderTile({
@required this.onTap,
@required this.title,
@required this.icon
});
final VoidCallback onTap;
final String title;
final Icon icon;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
padding: EdgeInsets.only(
left: 24,
right: 24,
top: 24,
bottom: 24
),
color: Colors.transparent,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
title,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white
),
),
Container(
height: 32,
width: 32,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: PaletteDark.menuList
),
child: icon,
)
],
),
),
);
}
}

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:qr/qr.dart'; import 'package:qr/qr.dart';
import 'package:cake_wallet/src/screens/receive/qr_painter.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_painter.dart';
class QrImage extends StatelessWidget { class QrImage extends StatelessWidget {
QrImage({ QrImage({

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/src/domain/monero/subaddress.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -9,13 +10,21 @@ import 'package:cake_wallet/src/stores/subaddress_creation/subaddress_creation_s
import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
class NewSubaddressPage extends BasePage { class NewSubaddressPage extends BasePage {
NewSubaddressPage({this.subaddress});
final Subaddress subaddress;
@override @override
String get title => S.current.new_subaddress_title; String get title => S.current.new_subaddress_title;
@override @override
Widget body(BuildContext context) => NewSubaddressForm(); Color get backgroundColor => PaletteDark.historyPanel;
@override
Widget body(BuildContext context) => NewSubaddressForm(subaddress);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,65 +43,93 @@ class NewSubaddressPage extends BasePage {
} }
class NewSubaddressForm extends StatefulWidget { class NewSubaddressForm extends StatefulWidget {
NewSubaddressForm(this.subaddress);
final Subaddress subaddress;
@override @override
NewSubaddressFormState createState() => NewSubaddressFormState(); NewSubaddressFormState createState() => NewSubaddressFormState(subaddress);
} }
class NewSubaddressFormState extends State<NewSubaddressForm> { class NewSubaddressFormState extends State<NewSubaddressForm> {
NewSubaddressFormState(this.subaddress);
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
final _labelController = TextEditingController(); final _labelController = TextEditingController();
final Subaddress subaddress;
@override
void initState() {
if (subaddress != null) _labelController.text = subaddress.label;
super.initState();
}
@override
void dispose() {
_labelController.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final subaddressCreationStore = final subaddressCreationStore =
Provider.of<SubadrressCreationStore>(context); Provider.of<SubadrressCreationStore>(context);
_labelController.addListener(() {
if (_labelController.text.isNotEmpty) {
subaddressCreationStore.setDisabledStatus(false);
} else {
subaddressCreationStore.setDisabledStatus(true);
}
});
return Form( return Form(
key: _formKey, key: _formKey,
child: Stack(children: <Widget>[ child: Container(
Center( color: PaletteDark.historyPanel,
child: Padding( padding: EdgeInsets.all(24.0),
padding: EdgeInsets.only(left: 35, right: 35), child: Column(
child: TextFormField( children: <Widget>[
controller: _labelController, Expanded(
decoration: InputDecoration( child: Center(
hintStyle: TextStyle(color: Theme.of(context).hintColor), child: BaseTextFormField(
hintText: S.of(context).new_subaddress_label_name, controller: _labelController,
focusedBorder: UnderlineInputBorder( hintText: S.of(context).new_subaddress_label_name,
borderSide: validator: (value) {
BorderSide(color: Palette.cakeGreen, width: 2.0)), subaddressCreationStore.validateSubaddressName(value);
enabledBorder: UnderlineInputBorder( return subaddressCreationStore.errorMessage;
borderSide: BorderSide( }
color: Theme.of(context).focusColor, )
width: 1.0))), )
validator: (value) { ),
subaddressCreationStore.validateSubaddressName(value); Observer(
return subaddressCreationStore.errorMessage;
}),
),
),
Positioned(
bottom: 20,
left: 20,
right: 20,
child: Observer(
builder: (_) => LoadingPrimaryButton( builder: (_) => LoadingPrimaryButton(
onPressed: () async { onPressed: () async {
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
await subaddressCreationStore.add( if (subaddress != null) {
label: _labelController.text); await subaddressCreationStore.setLabel(
Navigator.of(context).pop(); addressIndex: subaddress.id,
label: _labelController.text
);
} else {
await subaddressCreationStore.add(
label: _labelController.text);
}
} }
}, },
text: S.of(context).new_subaddress_create, text: subaddress != null
color: Theme.of(context) ? S.of(context).rename
.accentTextTheme : S.of(context).new_subaddress_create,
.button color: Colors.green,
.backgroundColor, textColor: Colors.white,
textColor: Theme.of(context).primaryTextTheme.button.color,
isLoading: isLoading:
subaddressCreationStore.state is SubaddressIsCreating), subaddressCreationStore.state is SubaddressIsCreating,
)) isDisabled: subaddressCreationStore.isDisabledStatus,
])); ),
)
],
),
)
);
} }
} }

View file

@ -16,6 +16,7 @@ abstract class AcountListStoreBase with Store {
AcountListStoreBase({@required WalletService walletService}) { AcountListStoreBase({@required WalletService walletService}) {
accounts = []; accounts = [];
isAccountCreating = false; isAccountCreating = false;
isDisabledStatus = true;
if (walletService.currentWallet != null) { if (walletService.currentWallet != null) {
_onWalletChanged(walletService.currentWallet); _onWalletChanged(walletService.currentWallet);
@ -37,10 +38,18 @@ abstract class AcountListStoreBase with Store {
@observable @observable
bool isAccountCreating; bool isAccountCreating;
@observable
bool isDisabledStatus;
AccountList _accountList; AccountList _accountList;
StreamSubscription<Wallet> _onWalletChangeSubscription; StreamSubscription<Wallet> _onWalletChangeSubscription;
StreamSubscription<List<Account>> _onAccountsChangeSubscription; StreamSubscription<List<Account>> _onAccountsChangeSubscription;
@action
void setDisabledStatus(bool isDisabled) {
isDisabledStatus = isDisabled;
}
@override @override
void dispose() { void dispose() {
_onWalletChangeSubscription.cancel(); _onWalletChangeSubscription.cancel();

View file

@ -17,6 +17,7 @@ class SubadrressCreationStore = SubadrressCreationStoreBase
abstract class SubadrressCreationStoreBase with Store { abstract class SubadrressCreationStoreBase with Store {
SubadrressCreationStoreBase({@required WalletService walletService}) { SubadrressCreationStoreBase({@required WalletService walletService}) {
state = SubaddressCreationStateInitial(); state = SubaddressCreationStateInitial();
isDisabledStatus = true;
if (walletService.currentWallet != null) { if (walletService.currentWallet != null) {
_onWalletChanged(walletService.currentWallet); _onWalletChanged(walletService.currentWallet);
@ -26,6 +27,7 @@ abstract class SubadrressCreationStoreBase with Store {
walletService.onWalletChange.listen(_onWalletChanged); walletService.onWalletChange.listen(_onWalletChanged);
} }
@observable
SubaddressCreationState state; SubaddressCreationState state;
@observable @observable
@ -34,11 +36,19 @@ abstract class SubadrressCreationStoreBase with Store {
@observable @observable
String errorMessage; String errorMessage;
@observable
bool isDisabledStatus;
SubaddressList _subaddressList; SubaddressList _subaddressList;
StreamSubscription<Wallet> _onWalletChangeSubscription; StreamSubscription<Wallet> _onWalletChangeSubscription;
StreamSubscription<Account> _onAccountChangeSubscription; StreamSubscription<Account> _onAccountChangeSubscription;
Account _account; Account _account;
@action
void setDisabledStatus(bool isDisabled) {
isDisabledStatus = isDisabled;
}
@override @override
void dispose() { void dispose() {
_onWalletChangeSubscription.cancel(); _onWalletChangeSubscription.cancel();
@ -61,6 +71,20 @@ abstract class SubadrressCreationStoreBase with Store {
} }
} }
Future<void> setLabel({int addressIndex, String label}) async {
try {
state = SubaddressIsCreating();
await _subaddressList.setLabelSubaddress(
accountIndex: _account.id,
addressIndex: addressIndex,
label: label
);
state = SubaddressCreatedSuccessfully();
} catch (e) {
state = SubaddressCreationFailure(error: e.toString());
}
}
Future<void> _onWalletChanged(Wallet wallet) async { Future<void> _onWalletChanged(Wallet wallet) async {
if (wallet is MoneroWallet) { if (wallet is MoneroWallet) {
_account = wallet.account; _account = wallet.account;

View file

@ -0,0 +1,70 @@
import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
import 'package:flutter/services.dart';
class BaseTextFormField extends StatelessWidget {
BaseTextFormField({
this.controller,
this.keyboardType = TextInputType.text,
this.textInputAction = TextInputAction.done,
this.textAlign = TextAlign.start,
this.autovalidate = false,
this.hintText = '',
this.maxLines = 1,
this.inputFormatters,
this.textColor = Colors.white,
this.hintColor = PaletteDark.walletCardText,
this.borderColor = PaletteDark.menuList,
this.validator
});
final TextEditingController controller;
final TextInputType keyboardType;
final TextInputAction textInputAction;
final TextAlign textAlign;
final bool autovalidate;
final String hintText;
final int maxLines;
final List<TextInputFormatter> inputFormatters;
final Color textColor;
final Color hintColor;
final Color borderColor;
final FormFieldValidator<String> validator;
@override
Widget build(BuildContext context) {
return TextFormField(
controller: controller,
keyboardType: keyboardType,
textInputAction: textInputAction,
textAlign: textAlign,
autovalidate: autovalidate,
maxLines: maxLines,
inputFormatters: inputFormatters,
style: TextStyle(
fontSize: 16.0,
color: textColor
),
decoration: InputDecoration(
hintStyle: TextStyle(
color: hintColor,
fontSize: 16
),
hintText: hintText,
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: borderColor,
width: 1.0
)
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: borderColor,
width: 1.0
)
)
),
validator: validator,
);
}
}

View file

@ -134,6 +134,10 @@
"share_address" : "Adresse teilen ", "share_address" : "Adresse teilen ",
"receive_amount" : "Menge", "receive_amount" : "Menge",
"subaddresses" : "Unteradressen", "subaddresses" : "Unteradressen",
"rename" : "Umbenennen",
"choose_account" : "Konto auswählen",
"create_new_account" : "Neues Konto erstellen",
"accounts_subaddresses" : "Konten und Unteradressen",
"restore_restore_wallet" : "Wallet wiederherstellen", "restore_restore_wallet" : "Wallet wiederherstellen",

View file

@ -134,6 +134,10 @@
"share_address" : "Share address", "share_address" : "Share address",
"receive_amount" : "Amount", "receive_amount" : "Amount",
"subaddresses" : "Subaddresses", "subaddresses" : "Subaddresses",
"rename" : "Rename",
"choose_account" : "Choose account",
"create_new_account" : "Create new account",
"accounts_subaddresses" : "Accounts and subaddresses",
"restore_restore_wallet" : "Restore Wallet", "restore_restore_wallet" : "Restore Wallet",

View file

@ -134,6 +134,10 @@
"share_address" : "Compartir dirección", "share_address" : "Compartir dirección",
"receive_amount" : "Cantidad", "receive_amount" : "Cantidad",
"subaddresses" : "Subdirecciones", "subaddresses" : "Subdirecciones",
"rename" : "Rebautizar",
"choose_account" : "Elegir cuenta",
"create_new_account" : "Crear una nueva cuenta",
"accounts_subaddresses" : "Cuentas y subdirecciones",
"restore_restore_wallet" : "Recuperar Cartera", "restore_restore_wallet" : "Recuperar Cartera",

View file

@ -134,6 +134,10 @@
"share_address" : "पता साझा करें", "share_address" : "पता साझा करें",
"receive_amount" : "रकम", "receive_amount" : "रकम",
"subaddresses" : "उप पते", "subaddresses" : "उप पते",
"rename" : "नाम बदलें",
"choose_account" : "खाता चुनें",
"create_new_account" : "नया खाता बनाएँ",
"accounts_subaddresses" : "लेखा और उपदेस",
"restore_restore_wallet" : "वॉलेट को पुनर्स्थापित करें", "restore_restore_wallet" : "वॉलेट को पुनर्स्थापित करें",

View file

@ -134,6 +134,10 @@
"share_address" : "住所を共有する", "share_address" : "住所を共有する",
"receive_amount" : "量", "receive_amount" : "量",
"subaddresses" : "サブアドレス", "subaddresses" : "サブアドレス",
"rename" : "リネーム",
"choose_account" : "アカウントを選択",
"create_new_account" : "新しいアカウントを作成する",
"accounts_subaddresses" : "アカウントとサブアドレス",
"restore_restore_wallet" : "ウォレットを復元", "restore_restore_wallet" : "ウォレットを復元",

View file

@ -134,6 +134,10 @@
"share_address" : "주소 공유", "share_address" : "주소 공유",
"receive_amount" : "양", "receive_amount" : "양",
"subaddresses" : "하위 주소", "subaddresses" : "하위 주소",
"rename" : "이름 바꾸기",
"choose_account" : "계정을 선택하십시오",
"create_new_account" : "새 계정을 만들",
"accounts_subaddresses" : "계정 및 하위 주소",
"restore_restore_wallet" : "월렛 복원", "restore_restore_wallet" : "월렛 복원",

View file

@ -134,6 +134,10 @@
"share_address" : "Deel adres", "share_address" : "Deel adres",
"receive_amount" : "Bedrag", "receive_amount" : "Bedrag",
"subaddresses" : "Subadressen", "subaddresses" : "Subadressen",
"rename" : "Hernoemen",
"choose_account" : "Kies account",
"create_new_account" : "Creëer een nieuw account",
"accounts_subaddresses" : "Accounts en subadressen",
"restore_restore_wallet" : "Portemonnee herstellen", "restore_restore_wallet" : "Portemonnee herstellen",

View file

@ -134,6 +134,10 @@
"share_address" : "Udostępnij adres", "share_address" : "Udostępnij adres",
"receive_amount" : "Ilość", "receive_amount" : "Ilość",
"subaddresses" : "Podadresy", "subaddresses" : "Podadresy",
"rename" : "Przemianować",
"choose_account" : "Wybierz konto",
"create_new_account" : "Stwórz nowe konto",
"accounts_subaddresses" : "Konta i podadresy",
"restore_restore_wallet" : "Przywróć portfel", "restore_restore_wallet" : "Przywróć portfel",

View file

@ -134,6 +134,10 @@
"share_address" : "Compartilhar endereço", "share_address" : "Compartilhar endereço",
"receive_amount" : "Quantia", "receive_amount" : "Quantia",
"subaddresses" : "Sub-endereços", "subaddresses" : "Sub-endereços",
"rename" : "Renomear",
"choose_account" : "Escolha uma conta",
"create_new_account" : "Criar nova conta",
"accounts_subaddresses" : "Contas e sub-endereços",
"restore_restore_wallet" : "Restaurar carteira", "restore_restore_wallet" : "Restaurar carteira",

View file

@ -134,6 +134,10 @@
"share_address" : "Поделиться адресом", "share_address" : "Поделиться адресом",
"receive_amount" : "Сумма", "receive_amount" : "Сумма",
"subaddresses" : "Субадреса", "subaddresses" : "Субадреса",
"rename" : "Переименовать",
"choose_account" : "Выберите аккаунт",
"create_new_account" : "Создать новый аккаунт",
"accounts_subaddresses" : "Аккаунты и субадреса",
"restore_restore_wallet" : "Восстановить кошелёк", "restore_restore_wallet" : "Восстановить кошелёк",

View file

@ -132,8 +132,12 @@
"share_address" : "Поділитися адресою", "share_address" : "Поділитися адресою",
"receive_amount" : "Баланс", "receive_amount" : "Сума",
"subaddresses" : "Субадреси", "subaddresses" : "Субадреси",
"rename" : "Перейменувати",
"choose_account" : "Оберіть акаунт",
"create_new_account" : "Створити новий акаунт",
"accounts_subaddresses" : "Акаунти та субадреси",
"restore_restore_wallet" : "Відновити гаманець", "restore_restore_wallet" : "Відновити гаманець",

View file

@ -134,6 +134,10 @@
"share_address" : "分享地址", "share_address" : "分享地址",
"receive_amount" : "量", "receive_amount" : "量",
"subaddresses" : "子地址", "subaddresses" : "子地址",
"rename" : "改名",
"choose_account" : "選擇帳號",
"create_new_account" : "建立新帳戶",
"accounts_subaddresses" : "帳戶和子地址",
"restore_restore_wallet" : "恢复钱包", "restore_restore_wallet" : "恢复钱包",