Merge redesign part 1.
BIN
assets/fonts/Poppins-SemiBold.ttf
Normal file
BIN
assets/images/2.0x/back_vector.png
Normal file
After Width: | Height: | Size: 337 B |
BIN
assets/images/2.0x/bitcoin_menu.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
assets/images/2.0x/duplicate.png
Normal file
After Width: | Height: | Size: 549 B |
BIN
assets/images/2.0x/eye_menu.png
Normal file
After Width: | Height: | Size: 939 B |
BIN
assets/images/2.0x/key_menu.png
Normal file
After Width: | Height: | Size: 923 B |
BIN
assets/images/2.0x/monero_menu.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/images/2.0x/nodes_menu.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/images/2.0x/open_book_menu.png
Normal file
After Width: | Height: | Size: 735 B |
BIN
assets/images/2.0x/question_mark.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/images/2.0x/reconnect_menu.png
Normal file
After Width: | Height: | Size: 875 B |
BIN
assets/images/2.0x/settings_menu.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
assets/images/2.0x/wallet_menu.png
Normal file
After Width: | Height: | Size: 659 B |
BIN
assets/images/3.0x/back_vector.png
Normal file
After Width: | Height: | Size: 459 B |
BIN
assets/images/3.0x/bitcoin_menu.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
assets/images/3.0x/duplicate.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
assets/images/3.0x/eye_menu.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/images/3.0x/key_menu.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/images/3.0x/monero_menu.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
assets/images/3.0x/nodes_menu.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/images/3.0x/open_book_menu.png
Normal file
After Width: | Height: | Size: 994 B |
BIN
assets/images/3.0x/question_mark.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
assets/images/3.0x/reconnect_menu.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/images/3.0x/settings_menu.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/images/3.0x/wallet_menu.png
Normal file
After Width: | Height: | Size: 920 B |
BIN
assets/images/back_vector.png
Normal file
After Width: | Height: | Size: 251 B |
BIN
assets/images/bitcoin_menu.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/images/duplicate.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
assets/images/eye_menu.png
Normal file
After Width: | Height: | Size: 536 B |
BIN
assets/images/key_menu.png
Normal file
After Width: | Height: | Size: 518 B |
BIN
assets/images/monero_menu.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/images/nodes_menu.png
Normal file
After Width: | Height: | Size: 597 B |
BIN
assets/images/open_book_menu.png
Normal file
After Width: | Height: | Size: 454 B |
BIN
assets/images/question_mark.png
Normal file
After Width: | Height: | Size: 713 B |
BIN
assets/images/reconnect_menu.png
Normal file
After Width: | Height: | Size: 495 B |
BIN
assets/images/settings_menu.png
Normal file
After Width: | Height: | Size: 594 B |
BIN
assets/images/wallet_menu.png
Normal file
After Width: | Height: | Size: 358 B |
|
@ -3,10 +3,11 @@ import 'package:cake_wallet/generated/i18n.dart';
|
|||
import 'package:cake_wallet/src/domain/common/wallet_type.dart';
|
||||
|
||||
class AmountValidator extends TextValidator {
|
||||
AmountValidator({WalletType type})
|
||||
AmountValidator({WalletType type, bool isAutovalidate = false})
|
||||
: super(
|
||||
errorMessage: S.current.error_text_amount,
|
||||
pattern: _pattern(type),
|
||||
isAutovalidate: isAutovalidate,
|
||||
minLength: 0,
|
||||
maxLength: 0);
|
||||
|
||||
|
|
12
lib/core/template_validator.dart
Normal file
|
@ -0,0 +1,12 @@
|
|||
import 'package:cake_wallet/core/validator.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
class TemplateValidator extends TextValidator {
|
||||
TemplateValidator()
|
||||
: super(
|
||||
minLength: 0,
|
||||
maxLength: 0,
|
||||
pattern: '''^[^`,'"]{1,20}\$''',
|
||||
errorMessage: S.current.error_text_template
|
||||
);
|
||||
}
|
|
@ -16,18 +16,20 @@ class TextValidator extends Validator<String> {
|
|||
this.maxLength,
|
||||
this.pattern,
|
||||
this.length,
|
||||
this.isAutovalidate = false,
|
||||
String errorMessage})
|
||||
: super(errorMessage: errorMessage);
|
||||
|
||||
final int minLength;
|
||||
final int maxLength;
|
||||
final List<int> length;
|
||||
final bool isAutovalidate;
|
||||
String pattern;
|
||||
|
||||
@override
|
||||
bool isValid(String value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return true;
|
||||
return isAutovalidate ? true : false;
|
||||
}
|
||||
|
||||
return value.length > (minLength ?? 0) &&
|
||||
|
@ -42,4 +44,4 @@ class TextValidator extends Validator<String> {
|
|||
class WalletNameValidator extends TextValidator {
|
||||
WalletNameValidator()
|
||||
: super(minLength: 1, maxLength: 15, pattern: '^[a-zA-Z0-9_]\$');
|
||||
}
|
||||
}
|
60
lib/di.dart
|
@ -4,11 +4,16 @@ import 'package:cake_wallet/src/domain/common/node.dart';
|
|||
import 'package:cake_wallet/src/domain/exchange/trade.dart';
|
||||
import 'package:cake_wallet/src/screens/contact/contact_list_page.dart';
|
||||
import 'package:cake_wallet/src/screens/contact/contact_page.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange_trade/exchange_confirm_page.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_page.dart';
|
||||
import 'package:cake_wallet/src/screens/nodes/node_create_or_edit_page.dart';
|
||||
import 'package:cake_wallet/src/screens/nodes/nodes_list_page.dart';
|
||||
import 'package:cake_wallet/src/screens/seed/wallet_seed_page.dart';
|
||||
import 'package:cake_wallet/src/screens/send/send_template_page.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/settings.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_keys/wallet_keys_page.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange/exchange_page.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange/exchange_template_page.dart';
|
||||
import 'package:cake_wallet/store/contact_list_store.dart';
|
||||
import 'package:cake_wallet/store/node_list_store.dart';
|
||||
import 'package:cake_wallet/store/settings_store.dart';
|
||||
|
@ -24,10 +29,13 @@ import 'package:cake_wallet/src/screens/receive/receive_page.dart';
|
|||
import 'package:cake_wallet/src/screens/send/send_page.dart';
|
||||
import 'package:cake_wallet/src/screens/subaddress/address_edit_or_create_page.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_list/wallet_list_page.dart';
|
||||
import 'package:cake_wallet/store/theme_changer_store.dart';
|
||||
import 'package:cake_wallet/store/wallet_list_store.dart';
|
||||
import 'package:cake_wallet/utils/mobx.dart';
|
||||
import 'package:cake_wallet/theme_changer.dart';
|
||||
import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/contact_list/contact_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/node_list/node_list_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_edit_or_create_view_model.dart';
|
||||
|
@ -42,6 +50,7 @@ import 'package:cake_wallet/view_model/settings/settings_view_model.dart';
|
|||
import 'package:cake_wallet/view_model/wallet_keys_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_seed_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
|
@ -58,7 +67,10 @@ import 'package:cake_wallet/store/dashboard/trades_store.dart';
|
|||
import 'package:cake_wallet/store/dashboard/trade_filter_store.dart';
|
||||
import 'package:cake_wallet/store/dashboard/transaction_filter_store.dart';
|
||||
import 'package:cake_wallet/store/dashboard/fiat_convertation_store.dart';
|
||||
import 'package:cake_wallet/store/dashboard/page_view_store.dart';
|
||||
import 'package:cake_wallet/store/templates/send_template_store.dart';
|
||||
import 'package:cake_wallet/store/templates/exchange_template_store.dart';
|
||||
import 'package:cake_wallet/src/domain/common/template.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_template.dart';
|
||||
|
||||
final getIt = GetIt.instance;
|
||||
|
||||
|
@ -97,7 +109,9 @@ Future setup(
|
|||
{Box<WalletInfo> walletInfoSource,
|
||||
Box<Node> nodeSource,
|
||||
Box<Contact> contactSource,
|
||||
Box<Trade> tradesSource}) async {
|
||||
Box<Trade> tradesSource,
|
||||
Box<Template> templates,
|
||||
Box<ExchangeTemplate> exchangeTemplates}) async {
|
||||
getIt.registerSingletonAsync<SharedPreferences>(
|
||||
() => SharedPreferences.getInstance());
|
||||
|
||||
|
@ -119,11 +133,13 @@ Future setup(
|
|||
ContactService(contactSource, getIt.get<AppStore>().contactListStore));
|
||||
getIt.registerSingleton<TradesStore>(TradesStore(
|
||||
tradesSource: tradesSource, settingsStore: getIt.get<SettingsStore>()));
|
||||
getIt.registerSingleton<TradeFilterStore>(
|
||||
TradeFilterStore(wallet: getIt.get<AppStore>().wallet));
|
||||
getIt.registerSingleton<TradeFilterStore>(TradeFilterStore());
|
||||
getIt.registerSingleton<TransactionFilterStore>(TransactionFilterStore());
|
||||
getIt.registerSingleton<FiatConvertationStore>(FiatConvertationStore());
|
||||
getIt.registerSingleton<PageViewStore>(PageViewStore());
|
||||
getIt.registerSingleton<SendTemplateStore>(
|
||||
SendTemplateStore(templateSource: templates));
|
||||
getIt.registerSingleton<ExchangeTemplateStore>(
|
||||
ExchangeTemplateStore(templateSource: exchangeTemplates));
|
||||
|
||||
getIt.registerFactory<KeyService>(
|
||||
() => KeyService(getIt.get<FlutterSecureStorage>()));
|
||||
|
@ -165,8 +181,7 @@ Future setup(
|
|||
appStore: getIt.get<AppStore>(),
|
||||
tradesStore: getIt.get<TradesStore>(),
|
||||
tradeFilterStore: getIt.get<TradeFilterStore>(),
|
||||
transactionFilterStore: getIt.get<TransactionFilterStore>(),
|
||||
pageViewStore: getIt.get<PageViewStore>()));
|
||||
transactionFilterStore: getIt.get<TransactionFilterStore>()));
|
||||
|
||||
getIt.registerFactory<AuthService>(() => AuthService(
|
||||
secureStorage: getIt.get<FlutterSecureStorage>(),
|
||||
|
@ -210,6 +225,7 @@ Future setup(
|
|||
addressEditOrCreateViewModel:
|
||||
getIt.get<WalletAddressEditOrCreateViewModel>(param1: item)));
|
||||
|
||||
// getIt.get<SendTemplateStore>()
|
||||
getIt.registerFactory<SendViewModel>(() => SendViewModel(
|
||||
getIt.get<AppStore>().wallet,
|
||||
getIt.get<AppStore>().settingsStore,
|
||||
|
@ -218,6 +234,9 @@ Future setup(
|
|||
getIt.registerFactory(
|
||||
() => SendPage(sendViewModel: getIt.get<SendViewModel>()));
|
||||
|
||||
// getIt.registerFactory(
|
||||
// () => SendTemplatePage(sendViewModel: getIt.get<SendViewModel>()));
|
||||
|
||||
getIt.registerFactory(() => WalletListViewModel(
|
||||
walletInfoSource, getIt.get<AppStore>(), getIt.get<KeyService>()));
|
||||
|
||||
|
@ -300,4 +319,31 @@ Future setup(
|
|||
|
||||
getIt.registerFactory(
|
||||
() => NodeCreateOrEditPage(getIt.get<NodeCreateOrEditViewModel>()));
|
||||
|
||||
getIt.registerFactory(() => ExchangeViewModel(
|
||||
wallet: getIt.get<AppStore>().wallet,
|
||||
exchangeTemplateStore: getIt.get<ExchangeTemplateStore>(),
|
||||
trades: tradesSource,
|
||||
tradesStore: getIt.get<TradesStore>()));
|
||||
|
||||
getIt.registerFactory(() => ExchangeTradeViewModel(
|
||||
wallet: getIt.get<AppStore>().wallet,
|
||||
trades: tradesSource,
|
||||
tradesStore: getIt.get<TradesStore>()));
|
||||
|
||||
getIt.registerFactory(() => ExchangePage(getIt.get<ExchangeViewModel>()));
|
||||
|
||||
getIt.registerFactory(
|
||||
() => ExchangeConfirmPage(tradesStore: getIt.get<TradesStore>()));
|
||||
|
||||
getIt.registerFactory(() => ExchangeTradePage(
|
||||
exchangeTradeViewModel: getIt.get<ExchangeTradeViewModel>()));
|
||||
|
||||
getIt.registerFactory(
|
||||
() => ExchangeTemplatePage(getIt.get<ExchangeViewModel>()));
|
||||
}
|
||||
|
||||
void setupThemeChangerStore(ThemeChanger themeChanger) {
|
||||
getIt.registerSingleton<ThemeChangerStore>(
|
||||
ThemeChangerStore(themeChanger: themeChanger));
|
||||
}
|
||||
|
|
|
@ -56,6 +56,8 @@ class S implements WidgetsLocalizations {
|
|||
String get choose_wallet_currency => "Please choose wallet currency:";
|
||||
String get clear => "Clear";
|
||||
String get confirm => "Confirm";
|
||||
String get confirm_delete_template => "This action will delete this template. Do you wish to continue?";
|
||||
String get confirm_delete_wallet => "This action will delete this wallet. Do you wish to continue?";
|
||||
String get confirm_sending => "Confirm sending";
|
||||
String get contact => "Contact";
|
||||
String get contact_name => "Contact Name";
|
||||
|
@ -94,7 +96,7 @@ class S implements WidgetsLocalizations {
|
|||
String get expired => "Expired";
|
||||
String get faq => "FAQ";
|
||||
String get fetching => "Fetching";
|
||||
String get filters => "Filters";
|
||||
String get filters => "Filter";
|
||||
String get first_wallet_text => "Awesome wallet for Monero";
|
||||
String get full_balance => "Full Balance";
|
||||
String get hidden_balance => "Hidden Balance";
|
||||
|
@ -133,6 +135,7 @@ class S implements WidgetsLocalizations {
|
|||
String get reconnect => "Reconnect";
|
||||
String get reconnect_alert_text => "Are you sure to reconnect?";
|
||||
String get reconnection => "Reconnection";
|
||||
String get refund_address => "Refund address";
|
||||
String get remove => "Remove";
|
||||
String get remove_node => "Remove node";
|
||||
String get remove_node_message => "Are you sure that you want to remove selected node?";
|
||||
|
@ -184,14 +187,13 @@ class S implements WidgetsLocalizations {
|
|||
String get send_estimated_fee => "Estimated fee:";
|
||||
String get send_fee => "Fee:";
|
||||
String get send_got_it => "Got it";
|
||||
String get send_monero_address => "Monero address";
|
||||
String get send_name => "Name";
|
||||
String get send_new => "New";
|
||||
String get send_payment_id => "Payment ID (optional)";
|
||||
String get send_sending => "Sending...";
|
||||
String get send_success => "Your Monero was successfully sent";
|
||||
String get send_templates => "Templates";
|
||||
String get send_title => "Send Monero";
|
||||
String get send_title => "Send";
|
||||
String get send_xmr => "Send XMR";
|
||||
String get send_your_wallet => "Your wallet";
|
||||
String get sending => "Sending";
|
||||
|
@ -235,6 +237,7 @@ class S implements WidgetsLocalizations {
|
|||
String get sync_status_starting_sync => "STARTING SYNC";
|
||||
String get sync_status_syncronized => "SYNCHRONIZED";
|
||||
String get sync_status_syncronizing => "SYNCHRONIZING";
|
||||
String get template => "Template";
|
||||
String get today => "Today";
|
||||
String get trade_details_created_at => "Created at";
|
||||
String get trade_details_fetching => "Fetching";
|
||||
|
@ -309,14 +312,15 @@ class S implements WidgetsLocalizations {
|
|||
String error_text_limits_loading_failed(String provider) => "Trade for ${provider} is not created. Limits loading failed";
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "Trade for ${provider} is not created. Amount is more then maximum: ${max} ${currency}";
|
||||
String error_text_minimal_limit(String provider, String min, String currency) => "Trade for ${provider} is not created. Amount is less then minimal: ${min} ${currency}";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "By pressing confirm, you will be sending ${fetchingLabel} ${from} from your wallet called ${walletName} to the address shown above. Or you can send from your external wallet to the above address/QR code.\n\nPlease press confirm to continue or go back to change the amounts.\n\n";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Please send ${fetchingLabel} ${from} to the address shown above.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "By pressing confirm, you will be sending ${fetchingLabel} ${from} from your wallet called ${walletName} to the address shown above. Or you can send from your external wallet to the above address/QR code.\n\nPlease press confirm to continue or go back to change the amounts.";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Please send ${fetchingLabel} ${from} to the address shown above.";
|
||||
String failed_authentication(String state_error) => "Failed authentication. ${state_error}";
|
||||
String max_value(String value, String currency) => "Max: ${value} ${currency}";
|
||||
String min_value(String value, String currency) => "Min: ${value} ${currency}";
|
||||
String openalias_alert_content(String recipient_name) => "You will be sending funds to\n${recipient_name}";
|
||||
String powered_by(String title) => "Powered by ${title}";
|
||||
String router_no_route(String name) => "No route defined for ${name}";
|
||||
String send_address(String cryptoCurrency) => "${cryptoCurrency} address";
|
||||
String send_priority(String transactionPriority) => "Currently the fee is set at ${transactionPriority} priority.\nTransaction priority can be adjusted in the settings";
|
||||
String time(String minutes, String seconds) => "${minutes}m ${seconds}s";
|
||||
String trade_details_copied(String title) => "${title} copied to Clipboard";
|
||||
|
@ -370,6 +374,8 @@ class $de extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "Unterbezahlt";
|
||||
@override
|
||||
String get refund_address => "Rückerstattungsadresse";
|
||||
@override
|
||||
String get welcome => "Willkommen zu";
|
||||
@override
|
||||
String get share_address => "Adresse teilen ";
|
||||
|
@ -680,6 +686,8 @@ class $de extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "SYNCHRONISIERT";
|
||||
@override
|
||||
String get template => "Vorlage";
|
||||
@override
|
||||
String get transaction_priority_medium => "Mittel";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "Transaktions-ID";
|
||||
|
@ -728,6 +736,8 @@ class $de extends S {
|
|||
@override
|
||||
String get trade_not_created => "Handel nicht angelegt.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "Diese Aktion löscht diese Brieftasche. Möchten Sie fortfahren?";
|
||||
@override
|
||||
String get restore_wallet_name => "Walletname";
|
||||
@override
|
||||
String get widgets_seed => "Seed";
|
||||
|
@ -736,6 +746,8 @@ class $de extends S {
|
|||
@override
|
||||
String get rename => "Umbenennen";
|
||||
@override
|
||||
String get confirm_delete_template => "Diese Aktion löscht diese Vorlage. Möchten Sie fortfahren?";
|
||||
@override
|
||||
String get restore_active_seed => "Aktives Seed";
|
||||
@override
|
||||
String get send_name => "Name";
|
||||
|
@ -798,7 +810,7 @@ class $de extends S {
|
|||
@override
|
||||
String get send => "Senden";
|
||||
@override
|
||||
String get send_title => "Senden Sie Monero";
|
||||
String get send_title => "Senden Sie";
|
||||
@override
|
||||
String get error_text_keys => "Walletschlüssel können nur 64 hexadezimale Zeichen enthalten";
|
||||
@override
|
||||
|
@ -882,8 +894,6 @@ class $de extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "Sie können die gesamte Cake Wallet-App von wiederherstellen Ihre Sicherungsdatei";
|
||||
@override
|
||||
String get send_monero_address => "Monero-Adresse";
|
||||
@override
|
||||
String get error_text_node_port => "Der Knotenport kann nur Nummern zwischen 0 und 65535 enthalten";
|
||||
@override
|
||||
String get add_new_word => "Neues Wort hinzufügen";
|
||||
|
@ -930,17 +940,19 @@ class $de extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "Handel für ${provider} wird nicht erstellt. Menge ist mehr als maximal: ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "${cryptoCurrency}-Adresse";
|
||||
@override
|
||||
String min_value(String value, String currency) => "Mindest: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "Authentifizierung fehlgeschlagen. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} Verbleibende Blöcke";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Durch Drücken von Bestätigen wird gesendet ${fetchingLabel} ${from} von Ihrer Brieftasche aus angerufen ${walletName} an die oben angegebene Adresse. Oder Sie können von Ihrem externen Portemonnaie an die oben angegebene Adresse / QR-Code senden.\n\nBitte bestätigen Sie, um fortzufahren, oder gehen Sie zurück, um die Beträge zu änderns.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Durch Drücken von Bestätigen wird gesendet ${fetchingLabel} ${from} von Ihrer Brieftasche aus angerufen ${walletName} an die oben angegebene Adresse. Oder Sie können von Ihrem externen Portemonnaie an die oben angegebene Adresse / QR-Code senden.\n\nBitte bestätigen Sie, um fortzufahren, oder gehen Sie zurück, um die Beträge zu änderns.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "Handel für ${provider} wird nicht erstellt. Das Laden der Limits ist fehlgeschlagen";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Bitte senden ${fetchingLabel} ${from} an die oben angegebene Adresse.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Bitte senden ${fetchingLabel} ${from} an die oben angegebene Adresse.'";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "Transaktion festschreiben\nMenge: ${amount}\nGebühr: ${fee}";
|
||||
@override
|
||||
|
@ -994,6 +1006,8 @@ class $hi extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "के तहत भुगतान किया";
|
||||
@override
|
||||
String get refund_address => "वापसी का पता";
|
||||
@override
|
||||
String get welcome => "स्वागत हे सेवा मेरे";
|
||||
@override
|
||||
String get share_address => "पता साझा करें";
|
||||
|
@ -1202,7 +1216,7 @@ class $hi extends S {
|
|||
@override
|
||||
String get estimated => "अनुमानित";
|
||||
@override
|
||||
String get filters => "फिल्टर";
|
||||
String get filters => "फ़िल्टर";
|
||||
@override
|
||||
String get settings_current_node => "वर्तमान नोड";
|
||||
@override
|
||||
|
@ -1304,6 +1318,8 @@ class $hi extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "सिंक्रनाइज़";
|
||||
@override
|
||||
String get template => "खाका";
|
||||
@override
|
||||
String get transaction_priority_medium => "मध्यम";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "लेनदेन आईडी";
|
||||
|
@ -1352,6 +1368,8 @@ class $hi extends S {
|
|||
@override
|
||||
String get trade_not_created => "व्यापार नहीं बनाया गया.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "यह क्रिया इस वॉलेट को हटा देगी। क्या आप जारी रखना चाहते हैं?";
|
||||
@override
|
||||
String get restore_wallet_name => "बटुए का नाम";
|
||||
@override
|
||||
String get widgets_seed => "बीज";
|
||||
|
@ -1360,6 +1378,8 @@ class $hi extends S {
|
|||
@override
|
||||
String get rename => "नाम बदलें";
|
||||
@override
|
||||
String get confirm_delete_template => "यह क्रिया इस टेम्पलेट को हटा देगी। क्या आप जारी रखना चाहते हैं?";
|
||||
@override
|
||||
String get restore_active_seed => "सक्रिय बीज";
|
||||
@override
|
||||
String get send_name => "नाम";
|
||||
|
@ -1422,7 +1442,7 @@ class $hi extends S {
|
|||
@override
|
||||
String get send => "संदेश";
|
||||
@override
|
||||
String get send_title => "संदेश Monero";
|
||||
String get send_title => "संदेश";
|
||||
@override
|
||||
String get error_text_keys => "वॉलेट कीज़ में हेक्स में केवल 64 वर्ण हो सकते हैं";
|
||||
@override
|
||||
|
@ -1506,8 +1526,6 @@ class $hi extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "आप से पूरे केक वॉलेट एप्लिकेशन को पुनर्स्थापित कर सकते हैं आपकी बैक-अप फ़ाइल";
|
||||
@override
|
||||
String get send_monero_address => "मोनरो पता";
|
||||
@override
|
||||
String get error_text_node_port => "नोड पोर्ट में केवल 0 और 65535 के बीच संख्याएँ हो सकती हैं";
|
||||
@override
|
||||
String get add_new_word => "नया शब्द जोड़ें";
|
||||
|
@ -1554,17 +1572,19 @@ class $hi extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "व्यापार ${provider} के लिए नहीं बनाया गया है। राशि अधिक है तो अधिकतम: ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "${cryptoCurrency} पता";
|
||||
@override
|
||||
String min_value(String value, String currency) => "मिन: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "प्रमाणीकरण विफल. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} शेष रहते हैं";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "पुष्टि दबाकर, आप भेज रहे होंगे ${fetchingLabel} ${from} अपने बटुए से ${walletName} ऊपर दिखाए गए पते पर। या आप अपने बाहरी वॉलेट से उपरोक्त पते / क्यूआर कोड पर भेज सकते हैं।\n\nकृपया जारी रखने या राशि बदलने के लिए वापस जाने के लिए पुष्टि करें दबाएं.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "पुष्टि दबाकर, आप भेज रहे होंगे ${fetchingLabel} ${from} अपने बटुए से ${walletName} ऊपर दिखाए गए पते पर। या आप अपने बाहरी वॉलेट से उपरोक्त पते / क्यूआर कोड पर भेज सकते हैं।\n\nकृपया जारी रखने या राशि बदलने के लिए वापस जाने के लिए पुष्टि करें दबाएं.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "व्यापार ${provider} के लिए नहीं बनाया गया है। लोडिंग की सीमाएं विफल रहीं";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "कृपया भेजें ${fetchingLabel} ${from} ऊपर दिखाए गए पते पर\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "कृपया भेजें ${fetchingLabel} ${from} ऊपर दिखाए गए पते पर";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "लेन-देन करें\nरकम: ${amount}\nशुल्क: ${fee}";
|
||||
@override
|
||||
|
@ -1618,6 +1638,8 @@ class $ru extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "Недоплаченная";
|
||||
@override
|
||||
String get refund_address => "Адрес возврата";
|
||||
@override
|
||||
String get welcome => "Приветствуем в";
|
||||
@override
|
||||
String get share_address => "Поделиться адресом";
|
||||
|
@ -1826,7 +1848,7 @@ class $ru extends S {
|
|||
@override
|
||||
String get estimated => "Примерно";
|
||||
@override
|
||||
String get filters => "Фильтры";
|
||||
String get filters => "Фильтр";
|
||||
@override
|
||||
String get settings_current_node => "Текущая нода";
|
||||
@override
|
||||
|
@ -1928,6 +1950,8 @@ class $ru extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "СИНХРОНИЗИРОВАН";
|
||||
@override
|
||||
String get template => "Шаблон";
|
||||
@override
|
||||
String get transaction_priority_medium => "Средний";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "ID транзакции";
|
||||
|
@ -1976,6 +2000,8 @@ class $ru extends S {
|
|||
@override
|
||||
String get trade_not_created => "Сделка не создана.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "Это действие удалит кошелек. Вы хотите продолжить?";
|
||||
@override
|
||||
String get restore_wallet_name => "Имя кошелька";
|
||||
@override
|
||||
String get widgets_seed => "Мнемоническая фраза";
|
||||
|
@ -1984,6 +2010,8 @@ class $ru extends S {
|
|||
@override
|
||||
String get rename => "Переименовать";
|
||||
@override
|
||||
String get confirm_delete_template => "Это действие удалит шаблон. Вы хотите продолжить?";
|
||||
@override
|
||||
String get restore_active_seed => "Активная мнемоническая фраза";
|
||||
@override
|
||||
String get send_name => "Имя";
|
||||
|
@ -2046,7 +2074,7 @@ class $ru extends S {
|
|||
@override
|
||||
String get send => "Отправить";
|
||||
@override
|
||||
String get send_title => "Отправить Monero";
|
||||
String get send_title => "Отправить";
|
||||
@override
|
||||
String get error_text_keys => "Ключи кошелька могут содержать только 64 символа в hex";
|
||||
@override
|
||||
|
@ -2130,8 +2158,6 @@ class $ru extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "Вы можете восстановить Cake Wallet из вашего back-up файла";
|
||||
@override
|
||||
String get send_monero_address => "Monero адрес";
|
||||
@override
|
||||
String get error_text_node_port => "Порт ноды может содержать только цифры от 0 до 65535";
|
||||
@override
|
||||
String get add_new_word => "Добавить новое слово";
|
||||
|
@ -2178,17 +2204,19 @@ class $ru extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "Сделка для ${provider} не создана. Сумма больше максимальной: ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "${cryptoCurrency} адрес";
|
||||
@override
|
||||
String min_value(String value, String currency) => "Мин: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "Ошибка аутентификации. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} Осталось блоков";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Нажимая подтвердить, вы отправите ${fetchingLabel} ${from} с вашего кошелька ${walletName} на адрес указанный выше. Или вы можете отправить со своего внешнего кошелька на вышеуказанный адрес/QR-код.\n\nПожалуйста, нажмите подтвердить для продолжения, или вернитесь назад для изменения суммы.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Нажимая подтвердить, вы отправите ${fetchingLabel} ${from} с вашего кошелька ${walletName} на адрес указанный выше. Или вы можете отправить со своего внешнего кошелька на вышеуказанный адрес/QR-код.\n\nПожалуйста, нажмите подтвердить для продолжения, или вернитесь назад для изменения суммы.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "Сделка для ${provider} не создана. Ошибка загрузки лимитов";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Пожалуйста отправьте ${fetchingLabel} ${from} на адрес, указанный выше.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Пожалуйста отправьте ${fetchingLabel} ${from} на адрес, указанный выше.";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "Подтвердить транзакцию \nСумма: ${amount}\nКомиссия: ${fee}";
|
||||
@override
|
||||
|
@ -2242,6 +2270,8 @@ class $ko extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "미지급";
|
||||
@override
|
||||
String get refund_address => "환불 주소";
|
||||
@override
|
||||
String get welcome => "환영 에";
|
||||
@override
|
||||
String get share_address => "주소 공유";
|
||||
|
@ -2552,6 +2582,8 @@ class $ko extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "동기화";
|
||||
@override
|
||||
String get template => "주형";
|
||||
@override
|
||||
String get transaction_priority_medium => "매질";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "트랜잭션 ID";
|
||||
|
@ -2600,6 +2632,8 @@ class $ko extends S {
|
|||
@override
|
||||
String get trade_not_created => "거래가 생성되지 않았습니다.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "이 작업은이 지갑을 삭제합니다. 계속 하시겠습니까?";
|
||||
@override
|
||||
String get restore_wallet_name => "지갑 이름";
|
||||
@override
|
||||
String get widgets_seed => "씨";
|
||||
|
@ -2608,6 +2642,8 @@ class $ko extends S {
|
|||
@override
|
||||
String get rename => "이름 바꾸기";
|
||||
@override
|
||||
String get confirm_delete_template => "이 작업은이 템플릿을 삭제합니다. 계속 하시겠습니까?";
|
||||
@override
|
||||
String get restore_active_seed => "활성 종자";
|
||||
@override
|
||||
String get send_name => "이름";
|
||||
|
@ -2670,7 +2706,7 @@ class $ko extends S {
|
|||
@override
|
||||
String get send => "보내다";
|
||||
@override
|
||||
String get send_title => "모네로 보내기";
|
||||
String get send_title => "보내다";
|
||||
@override
|
||||
String get error_text_keys => "지갑 키는 16 진수로 64 자만 포함 할 수 있습니다";
|
||||
@override
|
||||
|
@ -2754,8 +2790,6 @@ class $ko extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "백업 파일에서 전체 Cake Wallet 앱을 복원 할 수 있습니다.";
|
||||
@override
|
||||
String get send_monero_address => "모네로 주소";
|
||||
@override
|
||||
String get error_text_node_port => "노드 포트는 0에서 65535 사이의 숫자 만 포함 할 수 있습니다";
|
||||
@override
|
||||
String get add_new_word => "새로운 단어 추가";
|
||||
|
@ -2802,17 +2836,19 @@ class $ko extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "거래 ${provider} 가 생성되지 않습니다. 금액이 최대 값보다 많습니다. ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "${cryptoCurrency} 주소";
|
||||
@override
|
||||
String min_value(String value, String currency) => "최소: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "인증 실패. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} 남은 블록";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "확인을 누르면 전송됩니다 ${fetchingLabel} ${from} 지갑에서 ${walletName} 위에 표시된 주소로. 또는 외부 지갑에서 위의 주소 / QR 코드로 보낼 수 있습니다.\n\n확인을 눌러 계속하거나 금액을 변경하려면 돌아가십시오.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "확인을 누르면 전송됩니다 ${fetchingLabel} ${from} 지갑에서 ${walletName} 위에 표시된 주소로. 또는 외부 지갑에서 위의 주소 / QR 코드로 보낼 수 있습니다.\n\n확인을 눌러 계속하거나 금액을 변경하려면 돌아가십시오.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "거래 ${provider} 가 생성되지 않습니다. 로딩 실패";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "보내주세요 ${fetchingLabel} ${from} 위에 표시된 주소로.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "보내주세요 ${fetchingLabel} ${from} 위에 표시된 주소로.";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "커밋 거래\n양: ${amount}\n보수: ${fee}";
|
||||
@override
|
||||
|
@ -2866,6 +2902,8 @@ class $pt extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "Parcialmente paga";
|
||||
@override
|
||||
String get refund_address => "Endereço de reembolso";
|
||||
@override
|
||||
String get welcome => "Bem-vindo ao";
|
||||
@override
|
||||
String get share_address => "Compartilhar endereço";
|
||||
|
@ -3074,7 +3112,7 @@ class $pt extends S {
|
|||
@override
|
||||
String get estimated => "Estimado";
|
||||
@override
|
||||
String get filters => "Filtros";
|
||||
String get filters => "Filtro";
|
||||
@override
|
||||
String get settings_current_node => "Nó atual";
|
||||
@override
|
||||
|
@ -3176,6 +3214,8 @@ class $pt extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "SINCRONIZADO";
|
||||
@override
|
||||
String get template => "Modelo";
|
||||
@override
|
||||
String get transaction_priority_medium => "Média";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "ID da transação";
|
||||
|
@ -3224,6 +3264,8 @@ class $pt extends S {
|
|||
@override
|
||||
String get trade_not_created => "Troca não criada.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "Esta ação excluirá esta carteira. Você deseja continuar?";
|
||||
@override
|
||||
String get restore_wallet_name => "Nome da carteira";
|
||||
@override
|
||||
String get widgets_seed => "Semente";
|
||||
|
@ -3232,6 +3274,8 @@ class $pt extends S {
|
|||
@override
|
||||
String get rename => "Renomear";
|
||||
@override
|
||||
String get confirm_delete_template => "Esta ação excluirá este modelo. Você deseja continuar?";
|
||||
@override
|
||||
String get restore_active_seed => "Semente ativa";
|
||||
@override
|
||||
String get send_name => "Nome";
|
||||
|
@ -3294,7 +3338,7 @@ class $pt extends S {
|
|||
@override
|
||||
String get send => "Enviar";
|
||||
@override
|
||||
String get send_title => "Enviar Monero";
|
||||
String get send_title => "Enviar";
|
||||
@override
|
||||
String get error_text_keys => "As chaves da carteira podem conter apenas 64 caracteres em hexadecimal";
|
||||
@override
|
||||
|
@ -3378,8 +3422,6 @@ class $pt extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "Você pode restaurar todo o aplicativo Cake Wallet de seu arquivo de backup";
|
||||
@override
|
||||
String get send_monero_address => "Endereço Monero";
|
||||
@override
|
||||
String get error_text_node_port => "A porta do nó deve conter apenas números entre 0 e 65535";
|
||||
@override
|
||||
String get add_new_word => "Adicionar nova palavra";
|
||||
|
@ -3426,17 +3468,19 @@ class $pt extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "A troca por ${provider} não é criada. O valor é superior ao máximo: ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "Endereço ${cryptoCurrency}";
|
||||
@override
|
||||
String min_value(String value, String currency) => "Mín: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "Falha na autenticação. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} blocos restantes";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Ao confirmar, você enviará ${fetchingLabel} ${from} da sua carteira ${walletName} para o endereço exibido acima. Você também pode enviar com uma carteira externa para o endereço/código QR acima.\n\nPressione Confirmar para continuar ou volte para alterar os valores.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Ao confirmar, você enviará ${fetchingLabel} ${from} da sua carteira ${walletName} para o endereço exibido acima. Você também pode enviar com uma carteira externa para o endereço/código QR acima.\n\nPressione Confirmar para continuar ou volte para alterar os valores.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "A troca por ${provider} não é criada. Falha no carregamento dos limites";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Por favor, envie ${fetchingLabel} ${from} para o endereço mostrado acima.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Por favor, envie ${fetchingLabel} ${from} para o endereço mostrado acima.";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "Confirmar transação\nQuantia: ${amount}\nTaxa: ${fee}";
|
||||
@override
|
||||
|
@ -3490,6 +3534,8 @@ class $uk extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "Недоплачена";
|
||||
@override
|
||||
String get refund_address => "Адреса повернення коштів";
|
||||
@override
|
||||
String get welcome => "Вітаємо в";
|
||||
@override
|
||||
String get share_address => "Поділитися адресою";
|
||||
|
@ -3698,7 +3744,7 @@ class $uk extends S {
|
|||
@override
|
||||
String get estimated => "Приблизно ";
|
||||
@override
|
||||
String get filters => "Фільтри";
|
||||
String get filters => "Фільтр";
|
||||
@override
|
||||
String get settings_current_node => "Поточний вузол";
|
||||
@override
|
||||
|
@ -3800,6 +3846,8 @@ class $uk extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "СИНХРОНІЗОВАНИЙ";
|
||||
@override
|
||||
String get template => "Шаблон";
|
||||
@override
|
||||
String get transaction_priority_medium => "Середній";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "ID транзакції";
|
||||
|
@ -3848,6 +3896,8 @@ class $uk extends S {
|
|||
@override
|
||||
String get trade_not_created => "Операція не створена.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "Ця дія видалить гаманець. Ви хочете продовжити?";
|
||||
@override
|
||||
String get restore_wallet_name => "Ім'я гаманця";
|
||||
@override
|
||||
String get widgets_seed => "Мнемонічна фраза";
|
||||
|
@ -3856,6 +3906,8 @@ class $uk extends S {
|
|||
@override
|
||||
String get rename => "Перейменувати";
|
||||
@override
|
||||
String get confirm_delete_template => "Ця дія видалить шаблон. Ви хочете продовжити?";
|
||||
@override
|
||||
String get restore_active_seed => "Активна мнемонічна фраза";
|
||||
@override
|
||||
String get send_name => "Ім'я";
|
||||
|
@ -3918,7 +3970,7 @@ class $uk extends S {
|
|||
@override
|
||||
String get send => "Відправити";
|
||||
@override
|
||||
String get send_title => "Відправити Monero";
|
||||
String get send_title => "Відправити";
|
||||
@override
|
||||
String get error_text_keys => "Ключі гаманця можуть містити тільки 64 символів в hex";
|
||||
@override
|
||||
|
@ -4002,8 +4054,6 @@ class $uk extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "Ви можете відновити Cake Wallet з вашого резервного файлу";
|
||||
@override
|
||||
String get send_monero_address => "Monero адреса";
|
||||
@override
|
||||
String get error_text_node_port => "Порт вузла може містити тільки цифри від 0 до 65535";
|
||||
@override
|
||||
String get add_new_word => "Добавити нове слово";
|
||||
|
@ -4050,17 +4100,19 @@ class $uk extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "Операція для ${provider} не створена. Сума більше максимальної: ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "${cryptoCurrency} адреса";
|
||||
@override
|
||||
String min_value(String value, String currency) => "Мін: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "Помилка аутентифікації. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} Залишилось блоків";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Натиснувши підтвердити, ви відправите ${fetchingLabel} ${from} з вашого гаманця ${walletName} на адресу вказану вище. Або ви можете відправити зі свого зовнішнього гаманця на вищевказану адресу/QR-код.\n\nБудь ласка, натисніть підтвердити для продовження або поверніться назад щоб змінити суму.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Натиснувши підтвердити, ви відправите ${fetchingLabel} ${from} з вашого гаманця ${walletName} на адресу вказану вище. Або ви можете відправити зі свого зовнішнього гаманця на вищевказану адресу/QR-код.\n\nБудь ласка, натисніть підтвердити для продовження або поверніться назад щоб змінити суму.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "Операція для ${provider} не створена. Помилка завантаження лімітів";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Будь ласка, відправте ${fetchingLabel} ${from} на адресу, вказану вище.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Будь ласка, відправте ${fetchingLabel} ${from} на адресу, вказану вище.";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "Підтвердити транзакцію \nСума: ${amount}\nКомісія: ${fee}";
|
||||
@override
|
||||
|
@ -4114,6 +4166,8 @@ class $ja extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "支払不足";
|
||||
@override
|
||||
String get refund_address => "払い戻し住所";
|
||||
@override
|
||||
String get welcome => "ようこそ に";
|
||||
@override
|
||||
String get share_address => "住所を共有する";
|
||||
|
@ -4322,7 +4376,7 @@ class $ja extends S {
|
|||
@override
|
||||
String get estimated => "推定";
|
||||
@override
|
||||
String get filters => "フィルター";
|
||||
String get filters => "フィルタ";
|
||||
@override
|
||||
String get settings_current_node => "現在のノード";
|
||||
@override
|
||||
|
@ -4424,6 +4478,8 @@ class $ja extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "同期された";
|
||||
@override
|
||||
String get template => "テンプレート";
|
||||
@override
|
||||
String get transaction_priority_medium => "中";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "トランザクションID";
|
||||
|
@ -4472,6 +4528,8 @@ class $ja extends S {
|
|||
@override
|
||||
String get trade_not_created => "作成されていない取引";
|
||||
@override
|
||||
String get confirm_delete_wallet => "このアクションにより、このウォレットが削除されます。 続行しますか?";
|
||||
@override
|
||||
String get restore_wallet_name => "ウォレット名";
|
||||
@override
|
||||
String get widgets_seed => "シード";
|
||||
|
@ -4480,6 +4538,8 @@ class $ja extends S {
|
|||
@override
|
||||
String get rename => "リネーム";
|
||||
@override
|
||||
String get confirm_delete_template => "この操作により、このテンプレートが削除されます。 続行しますか?";
|
||||
@override
|
||||
String get restore_active_seed => "アクティブシード";
|
||||
@override
|
||||
String get send_name => "名前";
|
||||
|
@ -4542,7 +4602,7 @@ class $ja extends S {
|
|||
@override
|
||||
String get send => "送る";
|
||||
@override
|
||||
String get send_title => "Moneroを送信";
|
||||
String get send_title => "を送信";
|
||||
@override
|
||||
String get error_text_keys => "ウォレットキーには、16進数で64文字しか含めることができません";
|
||||
@override
|
||||
|
@ -4626,8 +4686,6 @@ class $ja extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "Cake Walletアプリ全体を復元できますバックアップファイル";
|
||||
@override
|
||||
String get send_monero_address => "Monero 住所";
|
||||
@override
|
||||
String get error_text_node_port => "ノードポートには、0〜65535の数字のみを含めることができます";
|
||||
@override
|
||||
String get add_new_word => "新しい単語を追加";
|
||||
|
@ -4674,17 +4732,19 @@ class $ja extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "${provider} の取引は作成されません。 金額は最大値を超えています: ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "${cryptoCurrency} 住所";
|
||||
@override
|
||||
String min_value(String value, String currency) => "分: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "認証失敗. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} 残りのブロック";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "確認を押すと、送信されます ${fetchingLabel} ${from} と呼ばれるあなたの財布から ${walletName} 上記のアドレスへ. または、外部ウォレットから上記のアドレス/ QRコードに送信できます.\n\n確認を押して続行するか、戻って金額を変更してください.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "確認を押すと、送信されます ${fetchingLabel} ${from} と呼ばれるあなたの財布から ${walletName} 上記のアドレスへ. または、外部ウォレットから上記のアドレス/ QRコードに送信できます.\n\n確認を押して続行するか、戻って金額を変更してください.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "${provider} の取引は作成されません。 制限の読み込みに失敗しました";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "送信してください ${fetchingLabel} ${from} 上記のアドレスへ.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "送信してください ${fetchingLabel} ${from} 上記のアドレスへ.";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "トランザクションをコミット\n量: ${amount}\n費用: ${fee}";
|
||||
@override
|
||||
|
@ -4742,6 +4802,8 @@ class $pl extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "Niedopłacone";
|
||||
@override
|
||||
String get refund_address => "Adres zwrotu";
|
||||
@override
|
||||
String get welcome => "Witamy w";
|
||||
@override
|
||||
String get share_address => "Udostępnij adres";
|
||||
|
@ -4950,7 +5012,7 @@ class $pl extends S {
|
|||
@override
|
||||
String get estimated => "Oszacowano";
|
||||
@override
|
||||
String get filters => "Filtry";
|
||||
String get filters => "Filtr";
|
||||
@override
|
||||
String get settings_current_node => "Bieżący węzeł";
|
||||
@override
|
||||
|
@ -5052,6 +5114,8 @@ class $pl extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "SYNCHRONIZOWANY";
|
||||
@override
|
||||
String get template => "Szablon";
|
||||
@override
|
||||
String get transaction_priority_medium => "Średni";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "Transakcja ID";
|
||||
|
@ -5100,6 +5164,8 @@ class $pl extends S {
|
|||
@override
|
||||
String get trade_not_created => "Handel nie utworzony.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "Ta czynność usunie ten portfel. Czy chcesz kontynuować?";
|
||||
@override
|
||||
String get restore_wallet_name => "Nazwa portfela";
|
||||
@override
|
||||
String get widgets_seed => "Ziarno";
|
||||
|
@ -5108,6 +5174,8 @@ class $pl extends S {
|
|||
@override
|
||||
String get rename => "Przemianować";
|
||||
@override
|
||||
String get confirm_delete_template => "Ta czynność usunie ten szablon. Czy chcesz kontynuować?";
|
||||
@override
|
||||
String get restore_active_seed => "Aktywne nasiona";
|
||||
@override
|
||||
String get send_name => "Imię";
|
||||
|
@ -5170,7 +5238,7 @@ class $pl extends S {
|
|||
@override
|
||||
String get send => "Wysłać";
|
||||
@override
|
||||
String get send_title => "Wyślij Monero";
|
||||
String get send_title => "Wyślij";
|
||||
@override
|
||||
String get error_text_keys => "Klucze portfela mogą zawierać tylko 64 znaki w systemie szesnastkowym";
|
||||
@override
|
||||
|
@ -5254,8 +5322,6 @@ class $pl extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "Możesz przywrócić całą aplikację Cake Wallet z plik kopii zapasowej";
|
||||
@override
|
||||
String get send_monero_address => "Adres Monero";
|
||||
@override
|
||||
String get error_text_node_port => "Port węzła może zawierać tylko liczby od 0 do 65535";
|
||||
@override
|
||||
String get add_new_word => "Dodaj nowe słowo";
|
||||
|
@ -5302,17 +5368,19 @@ class $pl extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "Wymiana dla ${provider} nie została utworzona. Kwota jest większa niż maksymalna: ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "Adres ${cryptoCurrency}";
|
||||
@override
|
||||
String min_value(String value, String currency) => "Min: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "Nieudane uwierzytelnienie. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} Bloki pozostałe";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Naciskając Potwierdź, wyślesz ${fetchingLabel} ${from} z twojego portfela ${walletName} z twojego portfela. Lub możesz wysłać z zewnętrznego portfela na powyższy adres / kod QR.\n\nNaciśnij Potwierdź, aby kontynuować lub wróć, aby zmienić kwoty.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Naciskając Potwierdź, wyślesz ${fetchingLabel} ${from} z twojego portfela ${walletName} z twojego portfela. Lub możesz wysłać z zewnętrznego portfela na powyższy adres / kod QR.\n\nNaciśnij Potwierdź, aby kontynuować lub wróć, aby zmienić kwoty.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "Wymiana dla ${provider} nie została utworzona. Ładowanie limitów nie powiodło się";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Proszę wyślij ${fetchingLabel} ${from} na adres podany powyżej.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Proszę wyślij ${fetchingLabel} ${from} na adres podany powyżej.";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "Zatwierdź transakcję\nIlość: ${amount}\nOpłata: ${fee}";
|
||||
@override
|
||||
|
@ -5366,6 +5434,8 @@ class $es extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "Poco pagado";
|
||||
@override
|
||||
String get refund_address => "Dirección de reembolso";
|
||||
@override
|
||||
String get welcome => "Bienvenido";
|
||||
@override
|
||||
String get share_address => "Compartir dirección";
|
||||
|
@ -5574,7 +5644,7 @@ class $es extends S {
|
|||
@override
|
||||
String get estimated => "Estimado";
|
||||
@override
|
||||
String get filters => "Filtros";
|
||||
String get filters => "Filtrar";
|
||||
@override
|
||||
String get settings_current_node => "Nodo actual";
|
||||
@override
|
||||
|
@ -5676,6 +5746,8 @@ class $es extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "SINCRONIZADO";
|
||||
@override
|
||||
String get template => "Plantilla";
|
||||
@override
|
||||
String get transaction_priority_medium => "Medio";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "ID de transacción";
|
||||
|
@ -5724,6 +5796,8 @@ class $es extends S {
|
|||
@override
|
||||
String get trade_not_created => "Comercio no se crea.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "Esta acción eliminará esta billetera. ¿Desea continuar?";
|
||||
@override
|
||||
String get restore_wallet_name => "Nombre de la billetera";
|
||||
@override
|
||||
String get widgets_seed => "Semilla";
|
||||
|
@ -5732,6 +5806,8 @@ class $es extends S {
|
|||
@override
|
||||
String get rename => "Rebautizar";
|
||||
@override
|
||||
String get confirm_delete_template => "Esta acción eliminará esta plantilla. ¿Desea continuar?";
|
||||
@override
|
||||
String get restore_active_seed => "Semilla activa";
|
||||
@override
|
||||
String get send_name => "Nombre";
|
||||
|
@ -5794,7 +5870,7 @@ class $es extends S {
|
|||
@override
|
||||
String get send => "Enviar";
|
||||
@override
|
||||
String get send_title => "Enviar Monero";
|
||||
String get send_title => "Enviar";
|
||||
@override
|
||||
String get error_text_keys => "Las llaves de billetera solo pueden contener 64 caracteres en hexadecimal";
|
||||
@override
|
||||
|
@ -5878,8 +5954,6 @@ class $es extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "Puede restaurar toda la aplicación Cake Wallet desde ysu archivo de respaldo";
|
||||
@override
|
||||
String get send_monero_address => "Dirección de Monero";
|
||||
@override
|
||||
String get error_text_node_port => "El puerto de nodo solo puede contener números entre 0 y 65535";
|
||||
@override
|
||||
String get add_new_word => "Agregar palabra nueva";
|
||||
|
@ -5926,17 +6000,19 @@ class $es extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "El comercio por ${provider} no se crea. La cantidad es más que el máximo: ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "Dirección de ${cryptoCurrency}";
|
||||
@override
|
||||
String min_value(String value, String currency) => "Min: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "Autenticación fallida. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} Bloques restantes";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Al presionar confirmar, enviará ${fetchingLabel} ${from} desde su billetera llamada ${walletName} a la dirección que se muestra arriba. O puede enviar desde su billetera externa a la dirección / código QR anterior.\n\nPresione confirmar para continuar o regrese para cambiar los montos.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Al presionar confirmar, enviará ${fetchingLabel} ${from} desde su billetera llamada ${walletName} a la dirección que se muestra arriba. O puede enviar desde su billetera externa a la dirección / código QR anterior.\n\nPresione confirmar para continuar o regrese para cambiar los montos.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "El comercio por ${provider} no se crea. Límites de carga fallidos";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Envíe ${fetchingLabel} ${from} a la dirección que se muestra arriba.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Envíe ${fetchingLabel} ${from} a la dirección que se muestra arriba.";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "Confirmar transacción\nCantidad: ${amount}\nCuota: ${fee}";
|
||||
@override
|
||||
|
@ -5990,6 +6066,8 @@ class $nl extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "Slecht betaald";
|
||||
@override
|
||||
String get refund_address => "Adres voor terugbetaling";
|
||||
@override
|
||||
String get welcome => "Welkom bij";
|
||||
@override
|
||||
String get share_address => "Deel adres";
|
||||
|
@ -6198,7 +6276,7 @@ class $nl extends S {
|
|||
@override
|
||||
String get estimated => "Geschatte";
|
||||
@override
|
||||
String get filters => "Filters";
|
||||
String get filters => "Filter";
|
||||
@override
|
||||
String get settings_current_node => "Huidige knooppunt";
|
||||
@override
|
||||
|
@ -6300,6 +6378,8 @@ class $nl extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "SYNCHRONIZED";
|
||||
@override
|
||||
String get template => "Sjabloon";
|
||||
@override
|
||||
String get transaction_priority_medium => "Medium";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "Transactie ID";
|
||||
|
@ -6348,6 +6428,8 @@ class $nl extends S {
|
|||
@override
|
||||
String get trade_not_created => "Handel niet gecreëerd.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "Met deze actie wordt deze portemonnee verwijderd. Wilt u doorgaan?";
|
||||
@override
|
||||
String get restore_wallet_name => "Portemonnee naam";
|
||||
@override
|
||||
String get widgets_seed => "Zaad";
|
||||
|
@ -6356,6 +6438,8 @@ class $nl extends S {
|
|||
@override
|
||||
String get rename => "Hernoemen";
|
||||
@override
|
||||
String get confirm_delete_template => "Met deze actie wordt deze sjabloon verwijderd. Wilt u doorgaan?";
|
||||
@override
|
||||
String get restore_active_seed => "Actief zaad";
|
||||
@override
|
||||
String get send_name => "Naam";
|
||||
|
@ -6418,7 +6502,7 @@ class $nl extends S {
|
|||
@override
|
||||
String get send => "Sturen";
|
||||
@override
|
||||
String get send_title => "Stuur Monero";
|
||||
String get send_title => "Stuur";
|
||||
@override
|
||||
String get error_text_keys => "Portefeuillesleutels kunnen maximaal 64 tekens bevatten in hexadecimale volgorde";
|
||||
@override
|
||||
|
@ -6502,8 +6586,6 @@ class $nl extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "Je kunt de hele Cake Wallet-app herstellen van uw back-upbestand";
|
||||
@override
|
||||
String get send_monero_address => "Monero-adres";
|
||||
@override
|
||||
String get error_text_node_port => "Knooppuntpoort kan alleen nummers tussen 0 en 65535 bevatten";
|
||||
@override
|
||||
String get add_new_word => "Nieuw woord toevoegen";
|
||||
|
@ -6550,17 +6632,19 @@ class $nl extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "Ruil voor ${provider} is niet gemaakt. Bedrag is meer dan maximaal: ${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "${cryptoCurrency}-adres";
|
||||
@override
|
||||
String min_value(String value, String currency) => "Min: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "Mislukte authenticatie. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} Resterende blokken";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Door op bevestigen te drukken, wordt u verzonden ${fetchingLabel} ${from} uit je portemonnee genoemd ${walletName} naar bovenstaand adres. Of u kunt uw externe portemonnee naar bovenstaand adres / QR-code sturen.\n\nDruk op bevestigen om door te gaan of terug te gaan om de bedragen te wijzigen.\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "Door op bevestigen te drukken, wordt u verzonden ${fetchingLabel} ${from} uit je portemonnee genoemd ${walletName} naar bovenstaand adres. Of u kunt uw externe portemonnee naar bovenstaand adres / QR-code sturen.\n\nDruk op bevestigen om door te gaan of terug te gaan om de bedragen te wijzigen.";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "Ruil voor ${provider} is niet gemaakt. Beperkingen laden mislukt";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Zend alstublieft ${fetchingLabel} ${from} naar bovenstaand adres.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "Zend alstublieft ${fetchingLabel} ${from} naar bovenstaand adres.";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "Verricht transactie\nBedrag: ${amount}\nhonorarium: ${fee}";
|
||||
@override
|
||||
|
@ -6614,6 +6698,8 @@ class $zh extends S {
|
|||
@override
|
||||
String get trade_state_underpaid => "支付不足";
|
||||
@override
|
||||
String get refund_address => "退款地址";
|
||||
@override
|
||||
String get welcome => "歡迎來到";
|
||||
@override
|
||||
String get share_address => "分享地址";
|
||||
|
@ -6822,7 +6908,7 @@ class $zh extends S {
|
|||
@override
|
||||
String get estimated => "估计的";
|
||||
@override
|
||||
String get filters => "筛选器";
|
||||
String get filters => "過濾";
|
||||
@override
|
||||
String get settings_current_node => "当前节点";
|
||||
@override
|
||||
|
@ -6924,6 +7010,8 @@ class $zh extends S {
|
|||
@override
|
||||
String get sync_status_syncronized => "已同步";
|
||||
@override
|
||||
String get template => "模板";
|
||||
@override
|
||||
String get transaction_priority_medium => "介质";
|
||||
@override
|
||||
String get transaction_details_transaction_id => "交易编号";
|
||||
|
@ -6972,6 +7060,8 @@ class $zh extends S {
|
|||
@override
|
||||
String get trade_not_created => "未建立交易.";
|
||||
@override
|
||||
String get confirm_delete_wallet => "此操作將刪除此錢包。 你想繼續嗎?";
|
||||
@override
|
||||
String get restore_wallet_name => "钱包名称";
|
||||
@override
|
||||
String get widgets_seed => "种子";
|
||||
|
@ -6980,6 +7070,8 @@ class $zh extends S {
|
|||
@override
|
||||
String get rename => "改名";
|
||||
@override
|
||||
String get confirm_delete_template => "此操作將刪除此模板。 你想繼續嗎?";
|
||||
@override
|
||||
String get restore_active_seed => "活性種子";
|
||||
@override
|
||||
String get send_name => "名稱";
|
||||
|
@ -7042,7 +7134,7 @@ class $zh extends S {
|
|||
@override
|
||||
String get send => "发送";
|
||||
@override
|
||||
String get send_title => "发送门罗币";
|
||||
String get send_title => "發送";
|
||||
@override
|
||||
String get error_text_keys => "钱包密钥只能包含16个字符的十六进制字符";
|
||||
@override
|
||||
|
@ -7126,8 +7218,6 @@ class $zh extends S {
|
|||
@override
|
||||
String get restore_description_from_backup => "您可以从还原整个Cake Wallet应用您的备份文件";
|
||||
@override
|
||||
String get send_monero_address => "门罗地址";
|
||||
@override
|
||||
String get error_text_node_port => "节点端口只能包含0到65535之间的数字";
|
||||
@override
|
||||
String get add_new_word => "添加新词";
|
||||
|
@ -7174,17 +7264,19 @@ class $zh extends S {
|
|||
@override
|
||||
String error_text_maximum_limit(String provider, String max, String currency) => "未創建 ${provider} 交易。 金額大於最大值:${max} ${currency}";
|
||||
@override
|
||||
String send_address(String cryptoCurrency) => "${cryptoCurrency} 地址";
|
||||
@override
|
||||
String min_value(String value, String currency) => "敏: ${value} ${currency}";
|
||||
@override
|
||||
String failed_authentication(String state_error) => "身份验证失败. ${state_error}";
|
||||
@override
|
||||
String Blocks_remaining(String status) => "${status} 剩余的块";
|
||||
@override
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "点击确认 您将发送 ${fetchingLabel} ${from} 从你的钱包里 ${walletName} 到上面显示的地址. 或者,您也可以从外部钱包发送上述地址/ QR码。\n\n请按确认继续或返回以更改金额\n\n";
|
||||
String exchange_result_confirm(String fetchingLabel, String from, String walletName) => "点击确认 您将发送 ${fetchingLabel} ${from} 从你的钱包里 ${walletName} 到上面显示的地址. 或者,您也可以从外部钱包发送上述地址/ QR码。\n\n请按确认继续或返回以更改金额";
|
||||
@override
|
||||
String error_text_limits_loading_failed(String provider) => "未創建 ${provider} 交易。 限制加載失敗";
|
||||
@override
|
||||
String exchange_result_description(String fetchingLabel, String from) => "请发送 ${fetchingLabel} ${from} 到上面显示的地址.\n\n'";
|
||||
String exchange_result_description(String fetchingLabel, String from) => "请发送 ${fetchingLabel} ${from} 到上面显示的地址.";
|
||||
@override
|
||||
String commit_transaction_amount_fee(String amount, String fee) => "提交交易\n量: ${amount}\nFee: ${fee}";
|
||||
@override
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:cake_wallet/reactions/bootstrap.dart';
|
||||
import 'package:cake_wallet/store/app_store.dart';
|
||||
import 'package:cake_wallet/store/authentication_store.dart';
|
||||
import 'package:cake_wallet/core/auth_service.dart';
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_wallet_service.dart';
|
||||
|
@ -52,6 +53,8 @@ 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';
|
||||
|
||||
bool isThemeChangerRegistered = false;
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
|
@ -127,6 +130,8 @@ void main() async {
|
|||
contactSource: contacts,
|
||||
tradesSource: trades,
|
||||
fiatConvertationService: fiatConvertationService,
|
||||
templates: templates,
|
||||
exchangeTemplates: exchangeTemplates,
|
||||
initialMigrationVersion: 4);
|
||||
|
||||
setReactions(
|
||||
|
@ -167,9 +172,11 @@ Future<void> initialSetup(
|
|||
@required Box<Node> nodes,
|
||||
@required Box<WalletInfo> walletInfoSource,
|
||||
@required Box<Contact> contactSource,
|
||||
@required Box<Trade> tradesSource,
|
||||
@required Box<Trade> tradesSource,
|
||||
@required FiatConvertationService fiatConvertationService,
|
||||
int initialMigrationVersion = 4}) async {
|
||||
@required Box<Template> templates,
|
||||
@required Box<ExchangeTemplate> exchangeTemplates,
|
||||
int initialMigrationVersion = 4}) async {
|
||||
await defaultSettingsMigration(
|
||||
version: initialMigrationVersion,
|
||||
sharedPreferences: sharedPreferences,
|
||||
|
@ -178,7 +185,9 @@ Future<void> initialSetup(
|
|||
walletInfoSource: walletInfoSource,
|
||||
nodeSource: nodes,
|
||||
contactSource: contactSource,
|
||||
tradesSource: tradesSource);
|
||||
tradesSource: tradesSource,
|
||||
templates: templates,
|
||||
exchangeTemplates: exchangeTemplates);
|
||||
await bootstrap(fiatConvertationService: fiatConvertationService);
|
||||
monero_wallet.onStartup();
|
||||
}
|
||||
|
@ -191,7 +200,8 @@ class CakeWalletApp extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final settingsStore = Provider.of<SettingsStore>(context);
|
||||
//final settingsStore = Provider.of<SettingsStore>(context);
|
||||
final settingsStore = getIt.get<AppStore>().settingsStore;
|
||||
|
||||
return ChangeNotifierProvider<ThemeChanger>(
|
||||
create: (_) => ThemeChanger(
|
||||
|
@ -222,12 +232,20 @@ class MaterialAppWithTheme extends StatelessWidget {
|
|||
final transactionDescriptions =
|
||||
Provider.of<Box<TransactionDescription>>(context);
|
||||
|
||||
final statusBarColor =
|
||||
settingsStore.isDarkTheme ? Colors.black : Colors.white;
|
||||
if (!isThemeChangerRegistered) {
|
||||
setupThemeChangerStore(theme);
|
||||
isThemeChangerRegistered = true;
|
||||
}
|
||||
|
||||
/*final statusBarColor =
|
||||
settingsStore.isDarkTheme ? Colors.black : Colors.white;*/
|
||||
final _settingsStore = getIt.get<AppStore>().settingsStore;
|
||||
|
||||
final statusBarColor = Colors.transparent;
|
||||
final statusBarBrightness =
|
||||
settingsStore.isDarkTheme ? Brightness.light : Brightness.dark;
|
||||
_settingsStore.isDarkTheme ? Brightness.light : Brightness.dark;
|
||||
final statusBarIconBrightness =
|
||||
settingsStore.isDarkTheme ? Brightness.light : Brightness.dark;
|
||||
_settingsStore.isDarkTheme ? Brightness.light : Brightness.dark;
|
||||
|
||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||
statusBarColor: statusBarColor,
|
||||
|
@ -264,4 +282,4 @@ class MaterialAppWithTheme extends StatelessWidget {
|
|||
authenticationStore: getIt.get<AuthenticationStore>(),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,15 +3,45 @@ import 'package:flutter/material.dart';
|
|||
class Palette {
|
||||
static const Color green = Color.fromRGBO(39, 206, 80, 1.0);
|
||||
static const Color red = Color.fromRGBO(255, 51, 51, 1.0);
|
||||
static const Color darkRed = Color.fromRGBO(204, 38, 38, 1.0);
|
||||
static const Color blueAlice = Color.fromRGBO(231, 240, 253, 1.0);
|
||||
static const Color lightBlue = Color.fromRGBO(172, 203, 238, 1.0);
|
||||
static const Color lavender = Color.fromRGBO(237, 245, 252, 1.0);
|
||||
static const Color oceanBlue = Color.fromRGBO(30, 52, 78, 1.0);
|
||||
static const Color lightBlueGrey = Color.fromRGBO(118, 131, 169, 1.0);
|
||||
static const Color periwinkle = Color.fromRGBO(197, 208, 230, 1.0);
|
||||
static const Color periwinkle = Color.fromRGBO(195, 210, 227, 1.0);
|
||||
static const Color blue = Color.fromRGBO(88, 143, 252, 1.0);
|
||||
static const Color darkLavender = Color.fromRGBO(225, 238, 250, 1.0);
|
||||
static const Color darkLavender = Color.fromRGBO(229, 238, 250, 1.0);
|
||||
static const Color nightBlue = Color.fromRGBO(46, 57, 96, 1.0);
|
||||
|
||||
static const Color moderateOrangeYellow = Color.fromRGBO(245, 134, 82, 1.0);
|
||||
static const Color moderateOrange = Color.fromRGBO(235, 117, 63, 1.0);
|
||||
static const Color shineGreen = Color.fromRGBO(76, 189, 87, 1.0);
|
||||
static const Color moderateGreen = Color.fromRGBO(45, 158, 56, 1.0);
|
||||
static const Color cornflower = Color.fromRGBO(85, 147, 240, 1.0);
|
||||
static const Color royalBlue = Color.fromRGBO(43, 114, 221, 1.0);
|
||||
static const Color lightRed = Color.fromRGBO(227, 87, 87, 1.0);
|
||||
static const Color persianRed = Color.fromRGBO(206, 55, 55, 1.0);
|
||||
|
||||
// NEW DESIGN
|
||||
static const Color blueCraiola = Color.fromRGBO(69, 110, 255, 1.0);
|
||||
static const Color darkBlueCraiola = Color.fromRGBO(53, 86, 136, 1.0);
|
||||
static const Color pinkFlamingo = Color.fromRGBO(240, 60, 243, 1.0);
|
||||
static const Color redHat = Color.fromRGBO(209, 68, 37, 1.0);
|
||||
static const Color shineOrange = Color.fromRGBO(255, 184, 78, 1.0);
|
||||
static const Color paleBlue = Color.fromRGBO(225, 228, 233, 1.0);
|
||||
static const Color violetBlue = Color.fromRGBO(56, 69, 103, 1.0);
|
||||
static const Color periwinkleCraiola = Color.fromRGBO(229, 232, 242, 1.0);
|
||||
static const Color moderatePurpleBlue = Color.fromRGBO(57, 74, 95, 1.0);
|
||||
static const Color moderateLavender = Color.fromRGBO(233, 242, 252, 1.0);
|
||||
static const Color wildLavender = Color.fromRGBO(224, 230, 246, 1.0);
|
||||
static const Color gray = Color.fromRGBO(112, 147, 186, 1.0);
|
||||
static const Color wildPeriwinkle = Color.fromRGBO(219, 227, 243, 1.0);
|
||||
static const Color darkGray = Color.fromRGBO(122, 147, 186, 1.0);
|
||||
static const Color shadowWhite = Color.fromRGBO(242, 245, 255, 1.0);
|
||||
static const Color niagara = Color.fromRGBO(152, 172, 201, 1.0);
|
||||
static const Color alizarinRed = Color.fromRGBO(233, 45, 45, 1.0);
|
||||
|
||||
// FIXME: Rename.
|
||||
static const Color eee = Color.fromRGBO(236, 239, 245, 1.0);
|
||||
static const Color xxx = Color.fromRGBO(72, 89, 109, 1);
|
||||
|
@ -21,8 +51,9 @@ class PaletteDark {
|
|||
//static const Color distantBlue = Color.fromRGBO(70, 85, 133, 1.0); // mainBackgroundColor
|
||||
static const Color lightDistantBlue = Color.fromRGBO(81, 96, 147, 1.0); // borderCardColor
|
||||
static const Color gray = Color.fromRGBO(140, 153, 201, 1.0); // walletCardText
|
||||
static const Color moderateBlue = Color.fromRGBO(63, 77, 122, 1.0); // walletCardSubAddressField
|
||||
static const Color darkNightBlue = Color.fromRGBO(33, 43, 73, 1.0); // historyPanel
|
||||
//static const Color violetBlue = Color.fromRGBO(51, 63, 104, 1.0); // walletCardAddressField
|
||||
//static const Color moderateBlue = Color.fromRGBO(63, 77, 122, 1.0); // walletCardSubAddressField
|
||||
//static const Color darkNightBlue = Color.fromRGBO(33, 43, 73, 1.0); // historyPanel
|
||||
static const Color pigeonBlue = Color.fromRGBO(91, 112, 146, 1.0); // historyPanelText
|
||||
static const Color moderateNightBlue = Color.fromRGBO(39, 53, 96, 1.0); // historyPanelButton
|
||||
static const Color headerNightBlue = Color.fromRGBO(41, 52, 84, 1.0); // menuHeader
|
||||
|
@ -42,13 +73,23 @@ class PaletteDark {
|
|||
static const Color lightOceanBlue = Color.fromRGBO(32, 45, 80, 1.0);
|
||||
static const Color lightNightBlue = Color.fromRGBO(39, 52, 89, 1.0);
|
||||
static const Color wildBlue = Color.fromRGBO(165, 176, 205, 1.0);
|
||||
static const Color buttonNightBlue = Color.fromRGBO(46, 57, 96, 1.0);
|
||||
static const Color lightBlueGrey = Color.fromRGBO(125, 141, 183, 1.0);
|
||||
static const Color lightVioletBlue = Color.fromRGBO(56, 71, 109, 1.0);
|
||||
static const Color darkVioletBlue = Color.fromRGBO(49, 60, 96, 1.0);
|
||||
static const Color wildVioletBlue = Color.fromRGBO(45, 60, 97, 1.0);
|
||||
static const Color darkNightBlue = Color.fromRGBO(33, 45, 76, 1.0);
|
||||
static const Color blueGrey = Color.fromRGBO(87, 98, 138, 1.0);
|
||||
static const Color moderateBlue = Color.fromRGBO(60, 73, 118, 1.0);
|
||||
static const Color deepPurpleBlue = Color.fromRGBO(19, 29, 56, 1.0);
|
||||
static const Color darkOceanBlue = Color.fromRGBO(30, 42, 73, 1.0);
|
||||
static const Color wildBlueGrey = Color.fromRGBO(125, 137, 182, 1.0);
|
||||
static const Color darkGrey = Color.fromRGBO(118, 131, 169, 1.0);
|
||||
static const Color dividerColor = Color.fromRGBO(48, 59, 95, 1.0);
|
||||
static const Color violetBlue = Color.fromRGBO(59, 72, 119, 1.0);
|
||||
static const Color deepPurpleBlue = Color.fromRGBO(19, 29, 56, 1.0);
|
||||
static const Color distantBlue = Color.fromRGBO(72, 85, 131, 1.0);
|
||||
static const Color moderateVioletBlue = Color.fromRGBO(62, 73, 113, 1.0);
|
||||
static const Color deepVioletBlue = Color.fromRGBO(52, 66, 104, 1.0);
|
||||
|
||||
// FIXME: Rename.
|
||||
static const Color eee = Color.fromRGBO(236, 239, 245, 1.0);
|
||||
|
|
|
@ -258,12 +258,7 @@ class Router {
|
|||
|
||||
case Routes.sendTemplate:
|
||||
return CupertinoPageRoute<void>(
|
||||
builder: (_) => Provider(
|
||||
create: (_) => SendStore(
|
||||
walletService: walletService,
|
||||
priceStore: priceStore,
|
||||
transactionDescriptions: transactionDescriptions),
|
||||
child: SendTemplatePage()));
|
||||
fullscreenDialog: true, builder: (_) => getIt.get<SendTemplatePage>());
|
||||
|
||||
case Routes.receive:
|
||||
return CupertinoPageRoute<void>(
|
||||
|
@ -363,7 +358,9 @@ class Router {
|
|||
|
||||
case Routes.exchangeTrade:
|
||||
return CupertinoPageRoute<void>(
|
||||
builder: (_) => MultiProvider(
|
||||
builder: (_) => getIt.get<ExchangeTradePage>());
|
||||
|
||||
/*MultiProvider(
|
||||
providers: [
|
||||
ProxyProvider<SettingsStore, ExchangeTradeStore>(
|
||||
update: (_, settingsStore, __) => ExchangeTradeStore(
|
||||
|
@ -379,12 +376,13 @@ class Router {
|
|||
priceStore: priceStore)),
|
||||
],
|
||||
child: ExchangeTradePage(),
|
||||
));
|
||||
));*/
|
||||
|
||||
case Routes.exchangeConfirm:
|
||||
return MaterialPageRoute<void>(
|
||||
builder: (_) =>
|
||||
ExchangeConfirmPage(trade: settings.arguments as Trade));
|
||||
builder: (_) => getIt.get<ExchangeConfirmPage>());
|
||||
|
||||
//ExchangeConfirmPage(trade: settings.arguments as Trade));
|
||||
|
||||
case Routes.tradeDetails:
|
||||
return MaterialPageRoute<void>(builder: (context) {
|
||||
|
@ -416,45 +414,12 @@ class Router {
|
|||
walletRestorationFromSeedVM: walletRestorationFromSeedVM));
|
||||
|
||||
case Routes.exchange:
|
||||
return MaterialPageRoute<void>(
|
||||
builder: (_) => MultiProvider(providers: [
|
||||
Provider(create: (_) {
|
||||
final xmrtoprovider = XMRTOExchangeProvider();
|
||||
|
||||
return ExchangeStore(
|
||||
initialProvider: xmrtoprovider,
|
||||
initialDepositCurrency: CryptoCurrency.xmr,
|
||||
initialReceiveCurrency: CryptoCurrency.btc,
|
||||
trades: trades,
|
||||
providerList: [
|
||||
xmrtoprovider,
|
||||
ChangeNowExchangeProvider(),
|
||||
MorphTokenExchangeProvider(trades: trades)
|
||||
],
|
||||
walletStore: walletStore);
|
||||
}),
|
||||
], child: ExchangePage()));
|
||||
return CupertinoPageRoute<void>(
|
||||
builder: (_) => getIt.get<ExchangePage>());
|
||||
|
||||
case Routes.exchangeTemplate:
|
||||
return MaterialPageRoute<void>(
|
||||
builder: (_) => Provider(
|
||||
create: (_) {
|
||||
final xmrtoprovider = XMRTOExchangeProvider();
|
||||
|
||||
return ExchangeStore(
|
||||
initialProvider: xmrtoprovider,
|
||||
initialDepositCurrency: CryptoCurrency.xmr,
|
||||
initialReceiveCurrency: CryptoCurrency.btc,
|
||||
trades: trades,
|
||||
providerList: [
|
||||
xmrtoprovider,
|
||||
ChangeNowExchangeProvider(),
|
||||
MorphTokenExchangeProvider(trades: trades)
|
||||
],
|
||||
walletStore: walletStore);
|
||||
},
|
||||
child: ExchangeTemplatePage(),
|
||||
));
|
||||
return CupertinoPageRoute<void>(
|
||||
builder: (_) => getIt.get<ExchangeTemplatePage>());
|
||||
|
||||
case Routes.settings:
|
||||
return MaterialPageRoute<void>(
|
||||
|
|
|
@ -15,21 +15,26 @@ abstract class BasePage extends StatelessWidget {
|
|||
|
||||
Color get backgroundLightColor => Colors.white;
|
||||
|
||||
Color get backgroundDarkColor => PaletteDark.darkNightBlue;
|
||||
Color get backgroundDarkColor => PaletteDark.backgroundColor;
|
||||
|
||||
Color get titleColor => null;
|
||||
|
||||
bool get resizeToAvoidBottomPadding => true;
|
||||
|
||||
Widget get endDrawer => null;
|
||||
|
||||
AppBarStyle get appBarStyle => AppBarStyle.regular;
|
||||
|
||||
Widget Function(BuildContext, Widget) get rootWrapper => null;
|
||||
|
||||
final _backArrowImage = Image.asset('assets/images/back_arrow.png', color: Colors.white);
|
||||
final _backArrowImageDarkTheme =
|
||||
Image.asset('assets/images/back_arrow_dark_theme.png', color: Colors.white);
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
final _closeButtonImage = Image.asset('assets/images/close_button.png');
|
||||
final _closeButtonImageDarkTheme =
|
||||
Image.asset('assets/images/close_button_dark_theme.png');
|
||||
|
||||
void onOpenEndDrawer() => _scaffoldKey.currentState.openEndDrawer();
|
||||
|
||||
void onClose(BuildContext context) => Navigator.of(context).pop();
|
||||
|
||||
Widget leading(BuildContext context) {
|
||||
|
@ -37,16 +42,13 @@ abstract class BasePage extends StatelessWidget {
|
|||
return null;
|
||||
}
|
||||
|
||||
final _themeChanger = Provider.of<ThemeChanger>(context);
|
||||
Image _closeButton, _backButton;
|
||||
final _backButton = Image.asset('assets/images/back_arrow.png',
|
||||
color: titleColor ?? Theme.of(context).primaryTextTheme.title.color);
|
||||
|
||||
if (_themeChanger.getTheme() == Themes.darkTheme) {
|
||||
_backButton = _backArrowImageDarkTheme;
|
||||
_closeButton = _closeButtonImageDarkTheme;
|
||||
} else {
|
||||
_backButton = _backArrowImage;
|
||||
_closeButton = _closeButtonImage;
|
||||
}
|
||||
final _themeChanger = Provider.of<ThemeChanger>(context);
|
||||
final _closeButton = _themeChanger.getTheme() == Themes.darkTheme
|
||||
? _closeButtonImageDarkTheme
|
||||
: _closeButtonImage;
|
||||
|
||||
return SizedBox(
|
||||
height: 37,
|
||||
|
@ -71,9 +73,8 @@ abstract class BasePage extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
//color: Theme.of(context).primaryTextTheme.title.color,
|
||||
color: Colors.white,
|
||||
),
|
||||
color: titleColor ??
|
||||
Theme.of(context).primaryTextTheme.title.color),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -123,9 +124,11 @@ abstract class BasePage extends StatelessWidget {
|
|||
final _isDarkTheme = _themeChanger.getTheme() == Themes.darkTheme;
|
||||
|
||||
final root = Scaffold(
|
||||
key: _scaffoldKey,
|
||||
backgroundColor:
|
||||
_isDarkTheme ? backgroundDarkColor : backgroundLightColor,
|
||||
resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
|
||||
endDrawer: endDrawer,
|
||||
appBar: appBar(context),
|
||||
body: body(context), //SafeArea(child: ),
|
||||
floatingActionButton: floatingActionButton(context));
|
||||
|
|
|
@ -5,16 +5,13 @@ import 'package:flutter/cupertino.dart';
|
|||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:dots_indicator/dots_indicator.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/action_button.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/balance_page.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/address_page.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/transactions_page.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
|
||||
|
||||
class DashboardPage extends BasePage {
|
||||
DashboardPage({
|
||||
|
@ -23,14 +20,28 @@ class DashboardPage extends BasePage {
|
|||
});
|
||||
|
||||
@override
|
||||
Color get backgroundLightColor => PaletteDark.backgroundColor;
|
||||
Color get backgroundLightColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
Color get backgroundDarkColor => PaletteDark.backgroundColor;
|
||||
Color get backgroundDarkColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
Widget Function(BuildContext, Widget) get rootWrapper =>
|
||||
(BuildContext context, Widget scaffold) => Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(colors: [
|
||||
Theme.of(context).accentColor,
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
Theme.of(context).primaryColor,
|
||||
], begin: Alignment.topRight, end: Alignment.bottomLeft)),
|
||||
child: scaffold);
|
||||
|
||||
@override
|
||||
bool get resizeToAvoidBottomPadding => false;
|
||||
|
||||
@override
|
||||
Widget get endDrawer => MenuWidget(walletViewModel);
|
||||
|
||||
@override
|
||||
Widget middle(BuildContext context) {
|
||||
return SyncIndicator(dashboardViewModel: walletViewModel);
|
||||
|
@ -38,24 +49,18 @@ class DashboardPage extends BasePage {
|
|||
|
||||
@override
|
||||
Widget trailing(BuildContext context) {
|
||||
final menuButton = Image.asset('assets/images/menu.png',
|
||||
color: Colors.white);
|
||||
final menuButton =
|
||||
Image.asset('assets/images/menu.png', color: Colors.white);
|
||||
|
||||
return Container(
|
||||
alignment: Alignment.centerRight,
|
||||
width: 40,
|
||||
child: FlatButton(
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
padding: EdgeInsets.all(0),
|
||||
onPressed: () async {
|
||||
await showDialog<void>(
|
||||
builder: (_) => MenuWidget(walletViewModel),
|
||||
context: context);
|
||||
},
|
||||
child: menuButton
|
||||
)
|
||||
);
|
||||
alignment: Alignment.centerRight,
|
||||
width: 40,
|
||||
child: FlatButton(
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
padding: EdgeInsets.all(0),
|
||||
onPressed: () => onOpenEndDrawer(),
|
||||
child: menuButton));
|
||||
}
|
||||
|
||||
final DashboardViewModel walletViewModel;
|
||||
|
@ -73,79 +78,64 @@ class DashboardPage extends BasePage {
|
|||
|
||||
@override
|
||||
Widget body(BuildContext context) {
|
||||
|
||||
_setEffects();
|
||||
|
||||
return SafeArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: PageView.builder(
|
||||
controller: controller,
|
||||
itemCount: pages.length,
|
||||
itemBuilder: (context, index) {
|
||||
return pages[index];
|
||||
})),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 24),
|
||||
child: SmoothPageIndicator(
|
||||
controller: controller,
|
||||
itemCount: pages.length,
|
||||
itemBuilder: (context, index) {
|
||||
return pages[index];
|
||||
}
|
||||
)
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: 24
|
||||
),
|
||||
child: Observer(
|
||||
builder: (_) {
|
||||
return DotsIndicator(
|
||||
dotsCount: pages.length,
|
||||
position: walletViewModel.currentPage,
|
||||
decorator: DotsDecorator(
|
||||
color: PaletteDark.cyanBlue,
|
||||
activeColor: Colors.white,
|
||||
size: Size(6, 6),
|
||||
activeSize: Size(6, 6),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 45,
|
||||
right: 45,
|
||||
bottom: 24
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: ActionButton(
|
||||
image: sendImage,
|
||||
title: S.of(context).send,
|
||||
route: Routes.send,
|
||||
alignment: Alignment.centerLeft,
|
||||
),
|
||||
count: pages.length,
|
||||
effect: ColorTransitionEffect(
|
||||
spacing: 6.0,
|
||||
radius: 6.0,
|
||||
dotWidth: 6.0,
|
||||
dotHeight: 6.0,
|
||||
dotColor: Theme.of(context).indicatorColor,
|
||||
activeDotColor: Colors.white),
|
||||
)),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(left: 45, right: 45, bottom: 24),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: ActionButton(
|
||||
image: sendImage,
|
||||
title: S.of(context).send,
|
||||
route: Routes.send,
|
||||
alignment: Alignment.centerLeft,
|
||||
),
|
||||
Flexible(
|
||||
child: ActionButton(
|
||||
),
|
||||
Flexible(
|
||||
child: ActionButton(
|
||||
image: exchangeImage,
|
||||
title: S.of(context).exchange,
|
||||
route: Routes.exchange
|
||||
),
|
||||
route: Routes.exchange),
|
||||
),
|
||||
Flexible(
|
||||
child: ActionButton(
|
||||
image: receiveImage,
|
||||
title: S.of(context).receive,
|
||||
route: Routes.receive,
|
||||
alignment: Alignment.centerRight,
|
||||
),
|
||||
Flexible(
|
||||
child: ActionButton(
|
||||
image: receiveImage,
|
||||
title: S.of(context).receive,
|
||||
route: Routes.receive,
|
||||
alignment: Alignment.centerRight,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
void _setEffects() {
|
||||
|
@ -157,16 +147,6 @@ class DashboardPage extends BasePage {
|
|||
pages.add(BalancePage(dashboardViewModel: walletViewModel));
|
||||
pages.add(TransactionsPage(dashboardViewModel: walletViewModel));
|
||||
|
||||
controller.addListener(() {
|
||||
walletViewModel.pageViewStore.setCurrentPage(controller.page);
|
||||
});
|
||||
|
||||
reaction((_) => walletViewModel.currentPage, (double currentPage) {
|
||||
if (controller.page != currentPage) {
|
||||
controller.jumpTo(currentPage);
|
||||
}
|
||||
});
|
||||
|
||||
_isEffectsInstalled = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,13 +22,13 @@ class WalletMenu {
|
|||
];
|
||||
|
||||
final List<Image> images = [
|
||||
Image.asset('assets/images/reconnect.png'),
|
||||
Image.asset('assets/images/wallet.png'),
|
||||
Image.asset('assets/images/nodes.png'),
|
||||
Image.asset('assets/images/eye.png'),
|
||||
Image.asset('assets/images/key.png'),
|
||||
Image.asset('assets/images/open_book.png'),
|
||||
Image.asset('assets/images/settings.png'),
|
||||
Image.asset('assets/images/reconnect_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/wallet_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/nodes_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/eye_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/key_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/open_book_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/settings_menu.png', height: 16, width: 16),
|
||||
];
|
||||
|
||||
final BuildContext context;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class ActionButton extends StatelessWidget{
|
||||
ActionButton({
|
||||
|
@ -36,7 +35,7 @@ class ActionButton extends StatelessWidget{
|
|||
width: 60,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: PaletteDark.nightBlue,
|
||||
color: Theme.of(context).buttonColor,
|
||||
shape: BoxShape.circle),
|
||||
child: image,
|
||||
),
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/screens/receive/widgets/qr_widget.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
@ -29,7 +28,11 @@ class AddressPage extends StatelessWidget {
|
|||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(25)),
|
||||
color: PaletteDark.nightBlue
|
||||
border: Border.all(
|
||||
color: Theme.of(context).textTheme.subhead.color,
|
||||
width: 1
|
||||
),
|
||||
color: Theme.of(context).buttonColor
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
|
||||
class BalancePage extends StatelessWidget {
|
||||
|
@ -26,7 +25,7 @@ class BalancePage extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontSize: 40,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: PaletteDark.cyanBlue,
|
||||
color: Theme.of(context).indicatorColor,
|
||||
height: 1
|
||||
),
|
||||
);
|
||||
|
@ -52,7 +51,7 @@ class BalancePage extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: PaletteDark.cyanBlue,
|
||||
color: Theme.of(context).indicatorColor,
|
||||
height: 1
|
||||
),
|
||||
);
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:intl/intl.dart';
|
|||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cake_wallet/src/stores/settings/settings_store.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class DateSectionRaw extends StatelessWidget {
|
||||
DateSectionRaw({this.date});
|
||||
|
@ -42,7 +41,7 @@ class DateSectionRaw extends StatelessWidget {
|
|||
child: Text(title,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: PaletteDark.darkCyanBlue
|
||||
color: Theme.of(context).textTheme.overline.backgroundColor
|
||||
))
|
||||
);
|
||||
}
|
||||
|
|
21
lib/src/screens/dashboard/widgets/filter_tile.dart
Normal file
|
@ -0,0 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class FilterTile extends StatelessWidget {
|
||||
FilterTile({@required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
top: 18,
|
||||
bottom: 18,
|
||||
left: 24,
|
||||
right: 24
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
155
lib/src/screens/dashboard/widgets/filter_widget.dart
Normal file
|
@ -0,0 +1,155 @@
|
|||
import 'dart:ui';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/filter_tile.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_background.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/checkbox_widget.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:date_range_picker/date_range_picker.dart' as date_rage_picker;
|
||||
|
||||
class FilterWidget extends StatelessWidget {
|
||||
FilterWidget({@required this.dashboardViewModel});
|
||||
|
||||
final DashboardViewModel dashboardViewModel;
|
||||
final backVector = Image.asset('assets/images/back_vector.png',
|
||||
color: Palette.darkBlueCraiola
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertBackground(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).filters,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Poppins',
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 24,
|
||||
right: 24,
|
||||
top: 24
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
child: Container(
|
||||
color: Theme.of(context).textTheme.body2.decorationColor,
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: dashboardViewModel.filterItems.length,
|
||||
separatorBuilder: (context, _) => Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).accentTextTheme.subhead.backgroundColor,
|
||||
),
|
||||
itemBuilder: (_, index1) {
|
||||
final title = dashboardViewModel.filterItems.keys.elementAt(index1);
|
||||
final section = dashboardViewModel.filterItems.values.elementAt(index1);
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 20,
|
||||
left: 24,
|
||||
right: 24
|
||||
),
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).accentTextTheme.subhead.color,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: 'Poppins',
|
||||
decoration: TextDecoration.none
|
||||
),
|
||||
),
|
||||
),
|
||||
ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: section.length,
|
||||
separatorBuilder: (context, _) => Container(
|
||||
height: 1,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
color: Theme.of(context).textTheme.body2.decorationColor,
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).accentTextTheme.subhead.backgroundColor,
|
||||
),
|
||||
),
|
||||
itemBuilder: (_, index2) {
|
||||
|
||||
final item = section[index2];
|
||||
final content = item.onChanged != null
|
||||
? CheckboxWidget(
|
||||
value: item.value,
|
||||
caption: item.caption,
|
||||
onChanged: item.onChanged
|
||||
)
|
||||
: GestureDetector(
|
||||
onTap: () async {
|
||||
final List<DateTime> picked =
|
||||
await date_rage_picker.showDatePicker(
|
||||
context: context,
|
||||
initialFirstDate: DateTime.now()
|
||||
.subtract(Duration(days: 1)),
|
||||
initialLastDate: (DateTime.now()),
|
||||
firstDate: DateTime(2015),
|
||||
lastDate: DateTime.now()
|
||||
.add(Duration(days: 1)));
|
||||
|
||||
if (picked != null && picked.length == 2) {
|
||||
dashboardViewModel.transactionFilterStore
|
||||
.changeStartDate(picked.first);
|
||||
dashboardViewModel.transactionFilterStore
|
||||
.changeEndDate(picked.last);
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 32),
|
||||
child: Text(
|
||||
item.caption,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
fontSize: 18,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w500,
|
||||
decoration: TextDecoration.none
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return FilterTile(child: content);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
AlertCloseButton(image: backVector)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,21 +1,18 @@
|
|||
import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
|
||||
import 'package:date_range_picker/date_range_picker.dart' as date_rage_picker;
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
|
||||
class HeaderRow extends StatelessWidget {
|
||||
HeaderRow({this.dashboardViewModel});
|
||||
|
||||
final DashboardViewModel dashboardViewModel;
|
||||
|
||||
final filterIcon = Image.asset('assets/images/filter_icon.png',
|
||||
color: PaletteDark.wildBlue);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final filterIcon = Image.asset('assets/images/filter_icon.png',
|
||||
color: Theme.of(context).textTheme.caption.decorationColor);
|
||||
|
||||
return Container(
|
||||
height: 52,
|
||||
color: Colors.transparent,
|
||||
|
@ -32,154 +29,23 @@ class HeaderRow extends StatelessWidget {
|
|||
color: Colors.white
|
||||
),
|
||||
),
|
||||
PopupMenuButton<int>(
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
enabled: false,
|
||||
value: -1,
|
||||
child: Text(S.of(context).transactions,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color))),
|
||||
PopupMenuItem(
|
||||
value: 0,
|
||||
child: Observer(
|
||||
builder: (_) => Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(S.of(context).incoming),
|
||||
Checkbox(
|
||||
value: dashboardViewModel
|
||||
.transactionFilterStore
|
||||
.displayIncoming,
|
||||
onChanged: (value) => dashboardViewModel
|
||||
.transactionFilterStore
|
||||
.toggleIncoming()
|
||||
)
|
||||
]))),
|
||||
PopupMenuItem(
|
||||
value: 1,
|
||||
child: Observer(
|
||||
builder: (_) => Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(S.of(context).outgoing),
|
||||
Checkbox(
|
||||
value: dashboardViewModel
|
||||
.transactionFilterStore
|
||||
.displayOutgoing,
|
||||
onChanged: (value) => dashboardViewModel
|
||||
.transactionFilterStore
|
||||
.toggleOutgoing(),
|
||||
)
|
||||
]))),
|
||||
PopupMenuItem(
|
||||
value: 2,
|
||||
child:
|
||||
Text(S.of(context).transactions_by_date)),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
enabled: false,
|
||||
value: -1,
|
||||
child: Text(S.of(context).trades,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color))),
|
||||
PopupMenuItem(
|
||||
value: 3,
|
||||
child: Observer(
|
||||
builder: (_) => Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text('XMR.TO'),
|
||||
Checkbox(
|
||||
value: dashboardViewModel
|
||||
.tradeFilterStore
|
||||
.displayXMRTO,
|
||||
onChanged: (value) => dashboardViewModel
|
||||
.tradeFilterStore
|
||||
.toggleDisplayExchange(
|
||||
ExchangeProviderDescription
|
||||
.xmrto),
|
||||
)
|
||||
]))),
|
||||
PopupMenuItem(
|
||||
value: 4,
|
||||
child: Observer(
|
||||
builder: (_) => Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text('Change.NOW'),
|
||||
Checkbox(
|
||||
value: dashboardViewModel
|
||||
.tradeFilterStore
|
||||
.displayChangeNow,
|
||||
onChanged: (value) => dashboardViewModel
|
||||
.tradeFilterStore
|
||||
.toggleDisplayExchange(
|
||||
ExchangeProviderDescription
|
||||
.changeNow),
|
||||
)
|
||||
]))),
|
||||
PopupMenuItem(
|
||||
value: 5,
|
||||
child: Observer(
|
||||
builder: (_) => Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text('MorphToken'),
|
||||
Checkbox(
|
||||
value: dashboardViewModel
|
||||
.tradeFilterStore
|
||||
.displayMorphToken,
|
||||
onChanged: (value) => dashboardViewModel
|
||||
.tradeFilterStore
|
||||
.toggleDisplayExchange(
|
||||
ExchangeProviderDescription
|
||||
.morphToken),
|
||||
)
|
||||
])))
|
||||
],
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (context) => FilterWidget(dashboardViewModel: dashboardViewModel)
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 36,
|
||||
width: 36,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: PaletteDark.oceanBlue
|
||||
color: Theme.of(context).textTheme.overline.color
|
||||
),
|
||||
child: filterIcon,
|
||||
),
|
||||
onSelected: (item) async {
|
||||
if (item == 2) {
|
||||
final picked =
|
||||
await date_rage_picker.showDatePicker(
|
||||
context: context,
|
||||
initialFirstDate: DateTime.now()
|
||||
.subtract(Duration(days: 1)),
|
||||
initialLastDate: (DateTime.now()),
|
||||
firstDate: DateTime(2015),
|
||||
lastDate: DateTime.now()
|
||||
.add(Duration(days: 1)));
|
||||
|
||||
if (picked != null && picked.length == 2) {
|
||||
dashboardViewModel.transactionFilterStore
|
||||
.changeStartDate(picked.first);
|
||||
dashboardViewModel.transactionFilterStore
|
||||
.changeEndDate(picked.last);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import 'dart:ui';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:cake_wallet/src/domain/common/wallet_type.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/wallet_menu.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
// FIXME: terrible design.
|
||||
|
||||
|
@ -16,14 +18,13 @@ class MenuWidget extends StatefulWidget {
|
|||
}
|
||||
|
||||
class MenuWidgetState extends State<MenuWidget> {
|
||||
final moneroIcon = Image.asset('assets/images/monero.png');
|
||||
final bitcoinIcon = Image.asset('assets/images/bitcoin.png');
|
||||
Image moneroIcon;
|
||||
Image bitcoinIcon;
|
||||
final largeScreen = 731;
|
||||
|
||||
double menuWidth;
|
||||
double screenWidth;
|
||||
double screenHeight;
|
||||
double opacity;
|
||||
|
||||
double headerHeight;
|
||||
double tileHeight;
|
||||
|
@ -35,9 +36,8 @@ class MenuWidgetState extends State<MenuWidget> {
|
|||
menuWidth = 0;
|
||||
screenWidth = 0;
|
||||
screenHeight = 0;
|
||||
opacity = 0;
|
||||
|
||||
headerHeight = 120;
|
||||
headerHeight = 137;
|
||||
tileHeight = 75;
|
||||
fromTopEdge = 50;
|
||||
fromBottomEdge = 30;
|
||||
|
@ -52,7 +52,6 @@ class MenuWidgetState extends State<MenuWidget> {
|
|||
|
||||
setState(() {
|
||||
menuWidth = screenWidth;
|
||||
opacity = 1;
|
||||
|
||||
if (screenHeight > largeScreen) {
|
||||
final scale = screenHeight / largeScreen;
|
||||
|
@ -70,6 +69,11 @@ class MenuWidgetState extends State<MenuWidget> {
|
|||
WalletMenu(context, () async => widget.dashboardViewModel.reconnect());
|
||||
final itemCount = walletMenu.items.length;
|
||||
|
||||
moneroIcon = Image.asset('assets/images/monero_menu.png',
|
||||
color: Theme.of(context).accentTextTheme.overline.decorationColor);
|
||||
bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png',
|
||||
color: Theme.of(context).accentTextTheme.overline.decorationColor);
|
||||
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
@ -81,175 +85,142 @@ class MenuWidgetState extends State<MenuWidget> {
|
|||
width: 4,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(2)),
|
||||
color: Theme.of(context).hintColor),
|
||||
color: PaletteDark.gray),
|
||||
)),
|
||||
SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () => null,
|
||||
child: Container(
|
||||
width: menuWidth,
|
||||
height: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(24),
|
||||
bottomLeft: Radius.circular(24)),
|
||||
color: Theme.of(context).primaryTextTheme.display1.color),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(24),
|
||||
bottomLeft: Radius.circular(24)),
|
||||
child: ListView.separated(
|
||||
itemBuilder: (_, index) {
|
||||
if (index == 0) {
|
||||
return Container(
|
||||
height: headerHeight,
|
||||
padding: EdgeInsets.only(
|
||||
left: 24,
|
||||
top: fromTopEdge,
|
||||
right: 24,
|
||||
bottom: fromBottomEdge),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.only(topLeft: Radius.circular(24)),
|
||||
child: Container(
|
||||
color: Theme.of(context).textTheme.body2.decorationColor,
|
||||
child: ListView.separated(
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
itemBuilder: (_, index) {
|
||||
if (index == 0) {
|
||||
return Container(
|
||||
height: headerHeight,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display1
|
||||
.color,
|
||||
Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display1
|
||||
.decorationColor,
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
left: 24,
|
||||
top: fromTopEdge,
|
||||
right: 24,
|
||||
bottom: fromBottomEdge),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
_iconFor(type: widget.dashboardViewModel.type),
|
||||
SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 42,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
widget.dashboardViewModel.subname !=
|
||||
null
|
||||
? MainAxisAlignment.spaceBetween
|
||||
: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.dashboardViewModel.name,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
if (widget.dashboardViewModel.subname !=
|
||||
null)
|
||||
Text(
|
||||
widget.dashboardViewModel.subname,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.overline
|
||||
.decorationColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 12),
|
||||
)
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
index--;
|
||||
|
||||
final item = walletMenu.items[index];
|
||||
final image = walletMenu.images[index] ?? Offstage();
|
||||
final isLastTile = index == itemCount - 1;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
walletMenu.action(index);
|
||||
},
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.body2
|
||||
.decorationColor,
|
||||
height: isLastTile ? headerHeight : tileHeight,
|
||||
padding: isLastTile
|
||||
? EdgeInsets.only(
|
||||
left: 24,
|
||||
right: 24,
|
||||
top: fromBottomEdge,
|
||||
//bottom: fromTopEdge
|
||||
)
|
||||
: EdgeInsets.only(left: 24, right: 24),
|
||||
alignment: isLastTile ? Alignment.topLeft : null,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
image,
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.display2
|
||||
.color,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold),
|
||||
))
|
||||
],
|
||||
),
|
||||
));
|
||||
},
|
||||
separatorBuilder: (_, index) => Container(
|
||||
height: 1,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.display2
|
||||
.color),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
_iconFor(type: widget.dashboardViewModel.type),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 40,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
widget.dashboardViewModel.subname != null
|
||||
? MainAxisAlignment.spaceBetween
|
||||
: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.dashboardViewModel.name,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.title
|
||||
.color,
|
||||
decoration: TextDecoration.none,
|
||||
fontFamily: 'Avenir Next',
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
if (widget.dashboardViewModel.subname != null)
|
||||
Text(
|
||||
widget.dashboardViewModel.subname,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.caption
|
||||
.color,
|
||||
decoration: TextDecoration.none,
|
||||
fontFamily: 'Avenir Next',
|
||||
fontSize: 12),
|
||||
)
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
index -= 1;
|
||||
final item = walletMenu.items[index];
|
||||
final image = walletMenu.images[index] ?? Offstage();
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
walletMenu.action(index);
|
||||
},
|
||||
child: index == itemCount - 1
|
||||
? Container(
|
||||
height: headerHeight,
|
||||
padding: EdgeInsets.only(
|
||||
left: 24,
|
||||
right: 24,
|
||||
top: fromBottomEdge,
|
||||
bottom: fromTopEdge),
|
||||
alignment: Alignment.topLeft,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(24)),
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.display1
|
||||
.color,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
image,
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item,
|
||||
style: TextStyle(
|
||||
decoration: TextDecoration.none,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.title
|
||||
.color,
|
||||
fontFamily: 'Avenir Next',
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
height: tileHeight,
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.display1
|
||||
.color,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
image,
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item,
|
||||
style: TextStyle(
|
||||
decoration: TextDecoration.none,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.title
|
||||
.color,
|
||||
fontFamily: 'Avenir Next',
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (_, index) => Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
itemCount: itemCount + 1),
|
||||
),
|
||||
),
|
||||
))
|
||||
.caption
|
||||
.decorationColor,
|
||||
),
|
||||
itemCount: itemCount + 1),
|
||||
)))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -13,35 +13,36 @@ class SyncIndicator extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Observer(
|
||||
builder: (_) {
|
||||
final syncIndicatorWidth = 250.0;
|
||||
final syncIndicatorWidth = 237.0;
|
||||
final status = dashboardViewModel.status;
|
||||
final statusText = status.title();
|
||||
final progress = status.progress();
|
||||
final statusText = status != null ? status.title() : '';
|
||||
final progress = status != null ? status.progress() : 0.0;
|
||||
final indicatorOffset = progress * syncIndicatorWidth;
|
||||
final indicatorWidth =
|
||||
progress <= 1 ? syncIndicatorWidth - indicatorOffset : 0.0;
|
||||
final indicatorWidth = progress < 1
|
||||
? indicatorOffset > 0 ? indicatorOffset : 0.0
|
||||
: syncIndicatorWidth;
|
||||
final indicatorColor = status is SyncedSyncStatus
|
||||
? PaletteDark.brightGreen
|
||||
: PaletteDark.orangeYellow;
|
||||
: Theme.of(context).textTheme.caption.color;
|
||||
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(15)),
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: syncIndicatorWidth,
|
||||
color: PaletteDark.lightNightBlue,
|
||||
color: Theme.of(context).textTheme.title.decorationColor,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
progress <= 1
|
||||
? Positioned(
|
||||
left: indicatorOffset,
|
||||
left: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
width: indicatorWidth,
|
||||
height: 30,
|
||||
color: PaletteDark.oceanBlue,
|
||||
color: Theme.of(context).textTheme.title.backgroundColor,
|
||||
)
|
||||
)
|
||||
: Offstage(),
|
||||
|
@ -70,7 +71,7 @@ class SyncIndicator extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: PaletteDark.wildBlue
|
||||
color: Theme.of(context).textTheme.title.color
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class TradeRow extends StatelessWidget {
|
||||
TradeRow({
|
||||
|
@ -66,7 +65,8 @@ class TradeRow extends StatelessWidget {
|
|||
Text(createdAtFormattedDate,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: PaletteDark.darkCyanBlue))
|
||||
color: Theme.of(context).textTheme
|
||||
.overline.backgroundColor))
|
||||
]),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/domain/common/transaction_direction.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
|
@ -35,7 +34,7 @@ class TransactionRow extends StatelessWidget {
|
|||
width: 36,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: PaletteDark.wildNightBlue
|
||||
color: Theme.of(context).textTheme.overline.decorationColor
|
||||
),
|
||||
child: Image.asset(
|
||||
direction == TransactionDirection.incoming
|
||||
|
@ -79,13 +78,15 @@ class TransactionRow extends StatelessWidget {
|
|||
Text(formattedDate,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: PaletteDark.darkCyanBlue)),
|
||||
color: Theme.of(context).textTheme
|
||||
.overline.backgroundColor)),
|
||||
Text(direction == TransactionDirection.incoming
|
||||
? formattedFiatAmount
|
||||
: '- ' + formattedFiatAmount,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: PaletteDark.darkCyanBlue))
|
||||
color: Theme.of(context).textTheme
|
||||
.overline.backgroundColor))
|
||||
]),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -75,7 +75,7 @@ class TransactionsPage extends StatelessWidget {
|
|||
}
|
||||
|
||||
return Container(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
color: Colors.transparent,
|
||||
height: 1);
|
||||
}
|
||||
)
|
||||
|
@ -84,7 +84,8 @@ class TransactionsPage extends StatelessWidget {
|
|||
S.of(context).placeholder_transactions,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey
|
||||
color: Theme.of(context).primaryTextTheme
|
||||
.overline.decorationColor
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1,66 +1,59 @@
|
|||
import 'dart:ui';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
|
||||
import 'package:cake_wallet/src/stores/exchange/exchange_store.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/stores/exchange_template/exchange_template_store.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange/widgets/present_provider_picker.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange/widgets/base_exchange_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/trail_button.dart';
|
||||
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
|
||||
|
||||
class ExchangePage extends BasePage {
|
||||
ExchangePage(this.exchangeViewModel);
|
||||
|
||||
final ExchangeViewModel exchangeViewModel;
|
||||
|
||||
@override
|
||||
String get title => S.current.exchange;
|
||||
|
||||
@override
|
||||
Color get backgroundLightColor => Palette.darkLavender;
|
||||
Color get titleColor => Colors.white;
|
||||
|
||||
@override
|
||||
Color get backgroundDarkColor => PaletteDark.moderateBlue;
|
||||
Color get backgroundLightColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
Widget middle(BuildContext context) {
|
||||
final exchangeStore = Provider.of<ExchangeStore>(context);
|
||||
|
||||
return PresentProviderPicker(exchangeStore: exchangeStore);
|
||||
}
|
||||
Color get backgroundDarkColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
Widget trailing(BuildContext context) {
|
||||
final exchangeStore = Provider.of<ExchangeStore>(context);
|
||||
|
||||
return TrailButton(
|
||||
caption: S.of(context).reset,
|
||||
onPressed: () => exchangeStore.reset()
|
||||
);
|
||||
}
|
||||
Widget middle(BuildContext context) =>
|
||||
PresentProviderPicker(exchangeViewModel: exchangeViewModel);
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) => ExchangeForm();
|
||||
}
|
||||
Widget trailing(BuildContext context) =>
|
||||
TrailButton(
|
||||
caption: S.of(context).reset,
|
||||
onPressed: () => exchangeViewModel.reset()
|
||||
);
|
||||
|
||||
class ExchangeForm extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => ExchangeFormState();
|
||||
}
|
||||
|
||||
class ExchangeFormState extends State<ExchangeForm> {
|
||||
Widget body(BuildContext context) =>
|
||||
BaseExchangeWidget(
|
||||
exchangeViewModel: exchangeViewModel,
|
||||
leading: leading(context),
|
||||
middle: middle(context),
|
||||
trailing: trailing(context),
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final exchangeStore = Provider.of<ExchangeStore>(context);
|
||||
final walletStore = Provider.of<WalletStore>(context);
|
||||
final exchangeTemplateStore = Provider.of<ExchangeTemplateStore>(context);
|
||||
|
||||
return BaseExchangeWidget(
|
||||
exchangeStore: exchangeStore,
|
||||
walletStore: walletStore,
|
||||
exchangeTemplateStore: exchangeTemplateStore,
|
||||
isTemplate: false
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
|
||||
body: Container(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: body(context)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,55 +1,51 @@
|
|||
import 'dart:ui';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
|
||||
import 'package:cake_wallet/src/stores/exchange/exchange_store.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange/widgets/present_provider_picker.dart';
|
||||
import 'package:cake_wallet/src/stores/exchange_template/exchange_template_store.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange/widgets/base_exchange_widget.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
|
||||
|
||||
class ExchangeTemplatePage extends BasePage {
|
||||
ExchangeTemplatePage(this.exchangeViewModel);
|
||||
|
||||
final ExchangeViewModel exchangeViewModel;
|
||||
|
||||
@override
|
||||
String get title => S.current.exchange_new_template;
|
||||
|
||||
@override
|
||||
Color get backgroundLightColor => Palette.darkLavender;
|
||||
Color get titleColor => Colors.white;
|
||||
|
||||
@override
|
||||
Color get backgroundDarkColor => PaletteDark.moderateBlue;
|
||||
Color get backgroundLightColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
Widget trailing(BuildContext context) {
|
||||
final exchangeStore = Provider.of<ExchangeStore>(context);
|
||||
|
||||
return PresentProviderPicker(exchangeStore: exchangeStore);
|
||||
}
|
||||
Color get backgroundDarkColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) => ExchangeTemplateForm();
|
||||
}
|
||||
Widget trailing(BuildContext context) =>
|
||||
PresentProviderPicker(exchangeViewModel: exchangeViewModel);
|
||||
|
||||
class ExchangeTemplateForm extends StatefulWidget{
|
||||
@override
|
||||
ExchangeTemplateFormState createState() => ExchangeTemplateFormState();
|
||||
}
|
||||
|
||||
class ExchangeTemplateFormState extends State<ExchangeTemplateForm> {
|
||||
Widget body(BuildContext context) =>
|
||||
BaseExchangeWidget(
|
||||
exchangeViewModel: exchangeViewModel,
|
||||
leading: leading(context),
|
||||
middle: middle(context),
|
||||
trailing: trailing(context),
|
||||
isTemplate: true
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final exchangeStore = Provider.of<ExchangeStore>(context);
|
||||
final walletStore = Provider.of<WalletStore>(context);
|
||||
final exchangeTemplateStore = Provider.of<ExchangeTemplateStore>(context);
|
||||
|
||||
return BaseExchangeWidget(
|
||||
exchangeStore: exchangeStore,
|
||||
walletStore: walletStore,
|
||||
exchangeTemplateStore: exchangeTemplateStore,
|
||||
isTemplate: true
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
|
||||
body: Container(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: body(context)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
import 'dart:ui';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_template.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||
import 'package:cake_wallet/src/widgets/template_tile.dart';
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
@ -12,50 +14,54 @@ import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
|||
import 'package:cake_wallet/src/domain/exchange/xmrto/xmrto_exchange_provider.dart';
|
||||
import 'package:cake_wallet/src/stores/exchange/exchange_trade_state.dart';
|
||||
import 'package:cake_wallet/src/stores/exchange/limits_state.dart';
|
||||
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
|
||||
import 'package:cake_wallet/src/stores/exchange/exchange_store.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange/widgets/exchange_card.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/src/widgets/top_panel.dart';
|
||||
import 'package:cake_wallet/src/stores/exchange_template/exchange_template_store.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
|
||||
import 'package:cake_wallet/core/address_validator.dart';
|
||||
import 'package:cake_wallet/core/amount_validator.dart';
|
||||
|
||||
class BaseExchangeWidget extends StatefulWidget {
|
||||
BaseExchangeWidget({
|
||||
@ required this.exchangeStore,
|
||||
@ required this.walletStore,
|
||||
@ required this.exchangeTemplateStore,
|
||||
@ required this.isTemplate,
|
||||
@required this.exchangeViewModel,
|
||||
this.leading,
|
||||
this.middle,
|
||||
this.trailing,
|
||||
this.isTemplate = false,
|
||||
});
|
||||
|
||||
final ExchangeStore exchangeStore;
|
||||
final WalletStore walletStore;
|
||||
final ExchangeTemplateStore exchangeTemplateStore;
|
||||
final ExchangeViewModel exchangeViewModel;
|
||||
final Widget leading;
|
||||
final Widget middle;
|
||||
final Widget trailing;
|
||||
final bool isTemplate;
|
||||
|
||||
@override
|
||||
BaseExchangeWidgetState createState() =>
|
||||
BaseExchangeWidgetState(
|
||||
exchangeStore: exchangeStore,
|
||||
walletStore: walletStore,
|
||||
exchangeTemplateStore: exchangeTemplateStore,
|
||||
isTemplate: isTemplate
|
||||
);
|
||||
BaseExchangeWidgetState createState() => BaseExchangeWidgetState(
|
||||
exchangeViewModel: exchangeViewModel,
|
||||
leading: leading,
|
||||
middle: middle,
|
||||
trailing: trailing,
|
||||
isTemplate: isTemplate);
|
||||
}
|
||||
|
||||
class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
|
||||
BaseExchangeWidgetState({
|
||||
@ required this.exchangeStore,
|
||||
@ required this.walletStore,
|
||||
@ required this.exchangeTemplateStore,
|
||||
@ required this.isTemplate,
|
||||
@required this.exchangeViewModel,
|
||||
@required this.leading,
|
||||
@required this.middle,
|
||||
@required this.trailing,
|
||||
@required this.isTemplate,
|
||||
});
|
||||
|
||||
final ExchangeStore exchangeStore;
|
||||
final WalletStore walletStore;
|
||||
final ExchangeTemplateStore exchangeTemplateStore;
|
||||
final ExchangeViewModel exchangeViewModel;
|
||||
final Widget leading;
|
||||
final Widget middle;
|
||||
final Widget trailing;
|
||||
final bool isTemplate;
|
||||
final double topPanelHeight = 290;
|
||||
|
||||
final depositKey = GlobalKey<ExchangeCardState>();
|
||||
final receiveKey = GlobalKey<ExchangeCardState>();
|
||||
|
@ -64,281 +70,368 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Image arrowBottomPurple = Image.asset(
|
||||
final arrowBottomPurple = Image.asset(
|
||||
'assets/images/arrow_bottom_purple_icon.png',
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
color: Colors.white,
|
||||
height: 8,
|
||||
);
|
||||
final Image arrowBottomCakeGreen = Image.asset(
|
||||
final arrowBottomCakeGreen = Image.asset(
|
||||
'assets/images/arrow_bottom_cake_green.png',
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
color: Colors.white,
|
||||
height: 8,
|
||||
);
|
||||
|
||||
final depositWalletName =
|
||||
exchangeStore.depositCurrency == CryptoCurrency.xmr
|
||||
? walletStore.name
|
||||
: null;
|
||||
exchangeViewModel.depositCurrency == CryptoCurrency.xmr
|
||||
? exchangeViewModel.wallet.name
|
||||
: null;
|
||||
final receiveWalletName =
|
||||
exchangeStore.receiveCurrency == CryptoCurrency.xmr
|
||||
? walletStore.name
|
||||
: null;
|
||||
exchangeViewModel.receiveCurrency == CryptoCurrency.xmr
|
||||
? exchangeViewModel.wallet.name
|
||||
: null;
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback(
|
||||
(_) => _setReactions(context, exchangeStore, walletStore));
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback((_) => _setReactions(context, exchangeViewModel));
|
||||
|
||||
return Container(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: ScrollableWithBottomSection(
|
||||
contentPadding: EdgeInsets.only(bottom: 24),
|
||||
content: Column(
|
||||
children: <Widget>[
|
||||
TopPanel(
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
edgeInsets: EdgeInsets.only(bottom: 24),
|
||||
widget: Column(
|
||||
children: <Widget>[
|
||||
TopPanel(
|
||||
color: Theme.of(context).accentTextTheme.title.color,
|
||||
widget: Observer(
|
||||
builder: (_) => ExchangeCard(
|
||||
key: depositKey,
|
||||
title: S.of(context).you_will_send,
|
||||
initialCurrency: exchangeStore.depositCurrency,
|
||||
initialWalletName: depositWalletName,
|
||||
initialAddress:
|
||||
exchangeStore.depositCurrency == walletStore.type
|
||||
? walletStore.address
|
||||
: exchangeStore.depositAddress,
|
||||
initialIsAmountEditable: true,
|
||||
initialIsAddressEditable: exchangeStore.isDepositAddressEnabled,
|
||||
isAmountEstimated: false,
|
||||
currencies: CryptoCurrency.all,
|
||||
onCurrencySelected: (currency) =>
|
||||
exchangeStore.changeDepositCurrency(currency: currency),
|
||||
imageArrow: arrowBottomPurple,
|
||||
currencyButtonColor: Theme.of(context).accentTextTheme.title.color,
|
||||
addressButtonsColor: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
currencyValueValidator: (value) {
|
||||
exchangeStore.validateCryptoCurrency(value);
|
||||
return exchangeStore.errorMessage;
|
||||
},
|
||||
addressTextFieldValidator: (value) {
|
||||
exchangeStore.validateAddress(value,
|
||||
cryptoCurrency: exchangeStore.depositCurrency);
|
||||
return exchangeStore.errorMessage;
|
||||
},
|
||||
),
|
||||
)
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 32, left: 24, right: 24),
|
||||
child: Observer(
|
||||
builder: (_) => ExchangeCard(
|
||||
key: receiveKey,
|
||||
title: S.of(context).you_will_get,
|
||||
initialCurrency: exchangeStore.receiveCurrency,
|
||||
initialWalletName: receiveWalletName,
|
||||
initialAddress:
|
||||
exchangeStore.receiveCurrency == walletStore.type
|
||||
? walletStore.address
|
||||
: exchangeStore.receiveAddress,
|
||||
initialIsAmountEditable: false,
|
||||
initialIsAddressEditable: exchangeStore.isReceiveAddressEnabled,
|
||||
isAmountEstimated: true,
|
||||
currencies: CryptoCurrency.all,
|
||||
onCurrencySelected: (currency) => exchangeStore
|
||||
.changeReceiveCurrency(currency: currency),
|
||||
imageArrow: arrowBottomCakeGreen,
|
||||
currencyButtonColor: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
addressButtonsColor: Theme.of(context).accentTextTheme.title.color,
|
||||
currencyValueValidator: (value) {
|
||||
exchangeStore.validateCryptoCurrency(value);
|
||||
return exchangeStore.errorMessage;
|
||||
},
|
||||
addressTextFieldValidator: (value) {
|
||||
exchangeStore.validateAddress(value,
|
||||
cryptoCurrency: exchangeStore.receiveCurrency);
|
||||
return exchangeStore.errorMessage;
|
||||
},
|
||||
)),
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
isTemplate
|
||||
? Offstage()
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 32,
|
||||
left: 24,
|
||||
bottom: 24
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
return Form(
|
||||
key: _formKey,
|
||||
child: ScrollableWithBottomSection(
|
||||
contentPadding: EdgeInsets.only(bottom: 24),
|
||||
content: Column(
|
||||
children: <Widget>[
|
||||
TopPanel(
|
||||
gradient: LinearGradient(colors: [
|
||||
Theme.of(context).primaryTextTheme.body1.color,
|
||||
Theme.of(context).primaryTextTheme.body1.decorationColor,
|
||||
], stops: [
|
||||
0.35,
|
||||
1.0
|
||||
], begin: Alignment.topLeft, end: Alignment.bottomRight),
|
||||
edgeInsets: EdgeInsets.only(bottom: 32),
|
||||
widget: Column(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).send_templates,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color
|
||||
),
|
||||
TopPanel(
|
||||
edgeInsets: EdgeInsets.all(0),
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.subtitle
|
||||
.color,
|
||||
Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.subtitle
|
||||
.decorationColor,
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight),
|
||||
widget: Column(
|
||||
children: <Widget>[
|
||||
CupertinoNavigationBar(
|
||||
leading: leading,
|
||||
middle: middle,
|
||||
trailing: trailing,
|
||||
backgroundColor: Colors.transparent,
|
||||
border: null,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(24, 29, 24, 32),
|
||||
child: Observer(
|
||||
builder: (_) => ExchangeCard(
|
||||
key: depositKey,
|
||||
title: S.of(context).you_will_send,
|
||||
initialCurrency:
|
||||
exchangeViewModel.depositCurrency,
|
||||
initialWalletName: depositWalletName,
|
||||
initialAddress: exchangeViewModel
|
||||
.depositCurrency ==
|
||||
exchangeViewModel.wallet.currency
|
||||
? exchangeViewModel.wallet.address
|
||||
: exchangeViewModel.depositAddress,
|
||||
initialIsAmountEditable: true,
|
||||
initialIsAddressEditable: exchangeViewModel
|
||||
.isDepositAddressEnabled,
|
||||
isAmountEstimated: false,
|
||||
currencies: CryptoCurrency.all,
|
||||
onCurrencySelected: (currency) =>
|
||||
exchangeViewModel.changeDepositCurrency(
|
||||
currency: currency),
|
||||
imageArrow: arrowBottomPurple,
|
||||
currencyButtonColor: Colors.transparent,
|
||||
addressButtonsColor:
|
||||
Theme.of(context).focusColor,
|
||||
borderColor: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.body2
|
||||
.color,
|
||||
currencyValueValidator: AmountValidator(
|
||||
type: exchangeViewModel.wallet.type),
|
||||
addressTextFieldValidator: AddressValidator(
|
||||
type:
|
||||
exchangeViewModel.depositCurrency),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 29, left: 24, right: 24),
|
||||
child: Observer(
|
||||
builder: (_) => ExchangeCard(
|
||||
key: receiveKey,
|
||||
title: S.of(context).you_will_get,
|
||||
initialCurrency:
|
||||
exchangeViewModel.receiveCurrency,
|
||||
initialWalletName: receiveWalletName,
|
||||
initialAddress:
|
||||
exchangeViewModel.receiveCurrency ==
|
||||
exchangeViewModel.wallet.currency
|
||||
? exchangeViewModel.wallet.address
|
||||
: exchangeViewModel.receiveAddress,
|
||||
initialIsAmountEditable: false,
|
||||
initialIsAddressEditable:
|
||||
exchangeViewModel.isReceiveAddressEnabled,
|
||||
isAmountEstimated: true,
|
||||
currencies: CryptoCurrency.all,
|
||||
onCurrencySelected: (currency) =>
|
||||
exchangeViewModel.changeReceiveCurrency(
|
||||
currency: currency),
|
||||
imageArrow: arrowBottomCakeGreen,
|
||||
currencyButtonColor: Colors.transparent,
|
||||
addressButtonsColor:
|
||||
Theme.of(context).focusColor,
|
||||
borderColor: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.body2
|
||||
.decorationColor,
|
||||
currencyValueValidator: AmountValidator(
|
||||
type: exchangeViewModel.wallet.type),
|
||||
addressTextFieldValidator: AddressValidator(
|
||||
type: exchangeViewModel.receiveCurrency),
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
isTemplate
|
||||
? Offstage()
|
||||
: Container(
|
||||
height: 40,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
child: Observer(
|
||||
builder: (_) {
|
||||
final itemCount = exchangeTemplateStore.templates.length + 1;
|
||||
|
||||
return ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: itemCount,
|
||||
itemBuilder: (context, index) {
|
||||
|
||||
if (index == 0) {
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context)
|
||||
.pushNamed(Routes.exchangeTemplate),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(right: 10),
|
||||
child: DottedBorder(
|
||||
borderType: BorderType.RRect,
|
||||
dashPattern: [8, 4],
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
strokeWidth: 2,
|
||||
radius: Radius.circular(20),
|
||||
child: Container(
|
||||
height: 40,
|
||||
width: 75,
|
||||
padding: EdgeInsets.only(left: 10, right: 10),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: Text(
|
||||
S.of(context).send_new,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
index -= 1;
|
||||
|
||||
final template = exchangeTemplateStore.templates[index];
|
||||
|
||||
return TemplateTile(
|
||||
amount: template.amount,
|
||||
from: template.depositCurrency,
|
||||
to: template.receiveCurrency,
|
||||
onTap: () {
|
||||
applyTemplate(exchangeStore, template);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
|
||||
bottomSection: Column(children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 15),
|
||||
child: Observer(builder: (_) {
|
||||
final description =
|
||||
exchangeStore.provider is XMRTOExchangeProvider
|
||||
? S.of(context).amount_is_guaranteed
|
||||
: S.of(context).amount_is_estimate;
|
||||
return Center(
|
||||
child: Text(
|
||||
description,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).primaryTextTheme.caption.color,
|
||||
fontSize: 12
|
||||
)),
|
||||
isTemplate
|
||||
? Offstage()
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(top: 30, left: 24, bottom: 24),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).send_templates,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.display4
|
||||
.color),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
isTemplate
|
||||
? PrimaryButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
exchangeTemplateStore.addTemplate(
|
||||
amount: exchangeStore.depositAmount,
|
||||
depositCurrency: exchangeStore.depositCurrency.toString(),
|
||||
receiveCurrency: exchangeStore.receiveCurrency.toString(),
|
||||
provider: exchangeStore.provider.toString(),
|
||||
depositAddress: exchangeStore.depositAddress,
|
||||
receiveAddress: exchangeStore.receiveAddress
|
||||
);
|
||||
exchangeTemplateStore.update();
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
text: S.of(context).save,
|
||||
color: Colors.green,
|
||||
textColor: Colors.white
|
||||
)
|
||||
: Observer(
|
||||
builder: (_) => LoadingPrimaryButton(
|
||||
text: S.of(context).exchange,
|
||||
? Offstage()
|
||||
: Container(
|
||||
height: 40,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
onTap: () => Navigator.of(context)
|
||||
.pushNamed(Routes.exchangeTemplate),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 1, right: 10),
|
||||
child: DottedBorder(
|
||||
borderType: BorderType.RRect,
|
||||
dashPattern: [6, 4],
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.display2
|
||||
.decorationColor,
|
||||
strokeWidth: 2,
|
||||
radius: Radius.circular(20),
|
||||
child: Container(
|
||||
height: 34,
|
||||
width: 75,
|
||||
padding: EdgeInsets.only(
|
||||
left: 10, right: 10),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20)),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: Text(
|
||||
S.of(context).send_new,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.display3
|
||||
.color),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
Observer(builder: (_) {
|
||||
final templates = exchangeViewModel.templates;
|
||||
final itemCount =
|
||||
exchangeViewModel.templates.length;
|
||||
|
||||
return ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: itemCount,
|
||||
itemBuilder: (context, index) {
|
||||
final template = templates[index];
|
||||
|
||||
return TemplateTile(
|
||||
key: UniqueKey(),
|
||||
amount: template.amount,
|
||||
from: template.depositCurrency,
|
||||
to: template.receiveCurrency,
|
||||
onTap: () {
|
||||
applyTemplate(
|
||||
exchangeViewModel, template);
|
||||
},
|
||||
onRemove: () {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (dialogContext) {
|
||||
return AlertWithTwoActions(
|
||||
alertTitle:
|
||||
S.of(context).template,
|
||||
alertContent: S
|
||||
.of(context)
|
||||
.confirm_delete_template,
|
||||
leftButtonText:
|
||||
S.of(context).delete,
|
||||
rightButtonText:
|
||||
S.of(context).cancel,
|
||||
actionLeftButton: () {
|
||||
Navigator.of(
|
||||
dialogContext)
|
||||
.pop();
|
||||
exchangeViewModel
|
||||
.exchangeTemplateStore
|
||||
.remove(
|
||||
template:
|
||||
template);
|
||||
exchangeViewModel
|
||||
.exchangeTemplateStore
|
||||
.update();
|
||||
},
|
||||
actionRightButton: () =>
|
||||
Navigator.of(
|
||||
dialogContext)
|
||||
.pop());
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
}),
|
||||
],
|
||||
)))
|
||||
],
|
||||
),
|
||||
bottomSectionPadding:
|
||||
EdgeInsets.only(left: 24, right: 24, bottom: 24),
|
||||
bottomSection: Column(children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 15),
|
||||
child: Observer(builder: (_) {
|
||||
final description =
|
||||
exchangeViewModel.provider is XMRTOExchangeProvider
|
||||
? S.of(context).amount_is_guaranteed
|
||||
: S.of(context).amount_is_estimate;
|
||||
return Center(
|
||||
child: Text(
|
||||
description,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.display4
|
||||
.decorationColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 12),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
isTemplate
|
||||
? PrimaryButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
exchangeStore.createTrade();
|
||||
exchangeViewModel.exchangeTemplateStore.addTemplate(
|
||||
amount: exchangeViewModel.depositAmount,
|
||||
depositCurrency:
|
||||
exchangeViewModel.depositCurrency.toString(),
|
||||
receiveCurrency:
|
||||
exchangeViewModel.receiveCurrency.toString(),
|
||||
provider: exchangeViewModel.provider.toString(),
|
||||
depositAddress: exchangeViewModel.depositAddress,
|
||||
receiveAddress: exchangeViewModel.receiveAddress);
|
||||
exchangeViewModel.exchangeTemplateStore.update();
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
color: Colors.blue,
|
||||
textColor: Colors.white,
|
||||
isLoading: exchangeStore.tradeState is TradeIsCreating,
|
||||
)),
|
||||
]),
|
||||
)),
|
||||
);
|
||||
text: S.of(context).save,
|
||||
color: Colors.green,
|
||||
textColor: Colors.white)
|
||||
: Observer(
|
||||
builder: (_) => LoadingPrimaryButton(
|
||||
text: S.of(context).exchange,
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
exchangeViewModel.createTrade();
|
||||
}
|
||||
},
|
||||
color: Palette.blueCraiola,
|
||||
textColor: Colors.white,
|
||||
isLoading:
|
||||
exchangeViewModel.tradeState is TradeIsCreating,
|
||||
)),
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
||||
void applyTemplate(ExchangeStore store, ExchangeTemplate template) {
|
||||
store.changeDepositCurrency(currency: CryptoCurrency.fromString(template.depositCurrency));
|
||||
store.changeReceiveCurrency(currency: CryptoCurrency.fromString(template.receiveCurrency));
|
||||
void applyTemplate(
|
||||
ExchangeViewModel exchangeViewModel, ExchangeTemplate template) {
|
||||
exchangeViewModel.changeDepositCurrency(
|
||||
currency: CryptoCurrency.fromString(template.depositCurrency));
|
||||
exchangeViewModel.changeReceiveCurrency(
|
||||
currency: CryptoCurrency.fromString(template.receiveCurrency));
|
||||
|
||||
switch (template.provider) {
|
||||
case 'XMR.TO':
|
||||
store.changeProvider(provider: store.providerList[0]);
|
||||
exchangeViewModel.changeProvider(
|
||||
provider: exchangeViewModel.providerList[0]);
|
||||
break;
|
||||
case 'ChangeNOW':
|
||||
store.changeProvider(provider: store.providerList[1]);
|
||||
exchangeViewModel.changeProvider(
|
||||
provider: exchangeViewModel.providerList[1]);
|
||||
break;
|
||||
case 'MorphToken':
|
||||
store.changeProvider(provider: store.providerList[2]);
|
||||
exchangeViewModel.changeProvider(
|
||||
provider: exchangeViewModel.providerList[2]);
|
||||
break;
|
||||
}
|
||||
|
||||
store.changeDepositAmount(amount: template.amount);
|
||||
store.depositAddress = template.depositAddress;
|
||||
store.receiveAddress = template.receiveAddress;
|
||||
exchangeViewModel.changeDepositAmount(amount: template.amount);
|
||||
exchangeViewModel.depositAddress = template.depositAddress;
|
||||
exchangeViewModel.receiveAddress = template.receiveAddress;
|
||||
}
|
||||
|
||||
void _setReactions(
|
||||
BuildContext context, ExchangeStore store, WalletStore walletStore) {
|
||||
BuildContext context, ExchangeViewModel exchangeViewModel) {
|
||||
if (_isReactionsSet) {
|
||||
return;
|
||||
}
|
||||
|
@ -347,7 +440,7 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
|
|||
final depositAmountController = depositKey.currentState.amountController;
|
||||
final receiveAddressController = receiveKey.currentState.addressController;
|
||||
final receiveAmountController = receiveKey.currentState.amountController;
|
||||
final limitsState = store.limitsState;
|
||||
final limitsState = exchangeViewModel.limitsState;
|
||||
|
||||
if (limitsState is LimitsLoadedSuccessfully) {
|
||||
final min = limitsState.limits.min != null
|
||||
|
@ -360,63 +453,66 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
|
|||
key.currentState.changeLimits(min: min, max: max);
|
||||
}
|
||||
|
||||
_onCurrencyChange(store.receiveCurrency, walletStore, receiveKey);
|
||||
_onCurrencyChange(store.depositCurrency, walletStore, depositKey);
|
||||
_onCurrencyChange(
|
||||
exchangeViewModel.receiveCurrency, exchangeViewModel, receiveKey);
|
||||
_onCurrencyChange(
|
||||
exchangeViewModel.depositCurrency, exchangeViewModel, depositKey);
|
||||
|
||||
reaction(
|
||||
(_) => walletStore.name,
|
||||
(String _) => _onWalletNameChange(
|
||||
walletStore, store.receiveCurrency, receiveKey));
|
||||
(_) => exchangeViewModel.wallet.name,
|
||||
(String _) => _onWalletNameChange(
|
||||
exchangeViewModel, exchangeViewModel.receiveCurrency, receiveKey));
|
||||
|
||||
reaction(
|
||||
(_) => walletStore.name,
|
||||
(String _) => _onWalletNameChange(
|
||||
walletStore, store.depositCurrency, depositKey));
|
||||
(_) => exchangeViewModel.wallet.name,
|
||||
(String _) => _onWalletNameChange(
|
||||
exchangeViewModel, exchangeViewModel.depositCurrency, depositKey));
|
||||
|
||||
reaction(
|
||||
(_) => store.receiveCurrency,
|
||||
(CryptoCurrency currency) =>
|
||||
_onCurrencyChange(currency, walletStore, receiveKey));
|
||||
(_) => exchangeViewModel.receiveCurrency,
|
||||
(CryptoCurrency currency) =>
|
||||
_onCurrencyChange(currency, exchangeViewModel, receiveKey));
|
||||
|
||||
reaction(
|
||||
(_) => store.depositCurrency,
|
||||
(CryptoCurrency currency) =>
|
||||
_onCurrencyChange(currency, walletStore, depositKey));
|
||||
(_) => exchangeViewModel.depositCurrency,
|
||||
(CryptoCurrency currency) =>
|
||||
_onCurrencyChange(currency, exchangeViewModel, depositKey));
|
||||
|
||||
reaction((_) => store.depositAmount, (String amount) {
|
||||
reaction((_) => exchangeViewModel.depositAmount, (String amount) {
|
||||
if (depositKey.currentState.amountController.text != amount) {
|
||||
depositKey.currentState.amountController.text = amount;
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => store.depositAddress, (String address) {
|
||||
reaction((_) => exchangeViewModel.depositAddress, (String address) {
|
||||
if (depositKey.currentState.addressController.text != address) {
|
||||
depositKey.currentState.addressController.text = address;
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => store.isDepositAddressEnabled, (bool isEnabled) {
|
||||
reaction((_) => exchangeViewModel.isDepositAddressEnabled,
|
||||
(bool isEnabled) {
|
||||
depositKey.currentState.isAddressEditable(isEditable: isEnabled);
|
||||
});
|
||||
|
||||
reaction((_) => store.receiveAmount, (String amount) {
|
||||
if (receiveKey.currentState.amountController.text !=
|
||||
store.receiveAmount) {
|
||||
reaction((_) => exchangeViewModel.receiveAmount, (String amount) {
|
||||
if (receiveKey.currentState.amountController.text != amount) {
|
||||
receiveKey.currentState.amountController.text = amount;
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => store.receiveAddress, (String address) {
|
||||
reaction((_) => exchangeViewModel.receiveAddress, (String address) {
|
||||
if (receiveKey.currentState.addressController.text != address) {
|
||||
receiveKey.currentState.addressController.text = address;
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => store.isReceiveAddressEnabled, (bool isEnabled) {
|
||||
reaction((_) => exchangeViewModel.isReceiveAddressEnabled,
|
||||
(bool isEnabled) {
|
||||
receiveKey.currentState.isAddressEditable(isEditable: isEnabled);
|
||||
});
|
||||
|
||||
reaction((_) => store.tradeState, (ExchangeTradeState state) {
|
||||
reaction((_) => exchangeViewModel.tradeState, (ExchangeTradeState state) {
|
||||
if (state is TradeIsCreatedFailure) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showDialog<void>(
|
||||
|
@ -426,18 +522,16 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
|
|||
alertTitle: S.of(context).error,
|
||||
alertContent: state.error,
|
||||
buttonText: S.of(context).ok,
|
||||
buttonAction: () => Navigator.of(context).pop()
|
||||
);
|
||||
buttonAction: () => Navigator.of(context).pop());
|
||||
});
|
||||
});
|
||||
}
|
||||
if (state is TradeIsCreatedSuccessfully) {
|
||||
Navigator.of(context)
|
||||
.pushNamed(Routes.exchangeConfirm, arguments: state.trade);
|
||||
Navigator.of(context).pushNamed(Routes.exchangeConfirm);
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => store.limitsState, (LimitsState state) {
|
||||
reaction((_) => exchangeViewModel.limitsState, (LimitsState state) {
|
||||
String min;
|
||||
String max;
|
||||
|
||||
|
@ -461,29 +555,31 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
|
|||
});
|
||||
|
||||
depositAddressController.addListener(
|
||||
() => store.depositAddress = depositAddressController.text);
|
||||
() => exchangeViewModel.depositAddress = depositAddressController.text);
|
||||
|
||||
depositAmountController.addListener(() {
|
||||
if (depositAmountController.text != store.depositAmount) {
|
||||
store.changeDepositAmount(amount: depositAmountController.text);
|
||||
if (depositAmountController.text != exchangeViewModel.depositAmount) {
|
||||
exchangeViewModel.changeDepositAmount(
|
||||
amount: depositAmountController.text);
|
||||
}
|
||||
});
|
||||
|
||||
receiveAddressController.addListener(
|
||||
() => store.receiveAddress = receiveAddressController.text);
|
||||
() => exchangeViewModel.receiveAddress = receiveAddressController.text);
|
||||
|
||||
receiveAmountController.addListener(() {
|
||||
if (receiveAmountController.text != store.receiveAmount) {
|
||||
store.changeReceiveAmount(amount: receiveAmountController.text);
|
||||
if (receiveAmountController.text != exchangeViewModel.receiveAmount) {
|
||||
exchangeViewModel.changeReceiveAmount(
|
||||
amount: receiveAmountController.text);
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => walletStore.address, (String address) {
|
||||
if (store.depositCurrency == CryptoCurrency.xmr) {
|
||||
reaction((_) => exchangeViewModel.wallet.address, (String address) {
|
||||
if (exchangeViewModel.depositCurrency == CryptoCurrency.xmr) {
|
||||
depositKey.currentState.changeAddress(address: address);
|
||||
}
|
||||
|
||||
if (store.receiveCurrency == CryptoCurrency.xmr) {
|
||||
if (exchangeViewModel.receiveCurrency == CryptoCurrency.xmr) {
|
||||
receiveKey.currentState.changeAddress(address: address);
|
||||
}
|
||||
});
|
||||
|
@ -491,30 +587,32 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
|
|||
_isReactionsSet = true;
|
||||
}
|
||||
|
||||
void _onCurrencyChange(CryptoCurrency currency, WalletStore walletStore,
|
||||
GlobalKey<ExchangeCardState> key) {
|
||||
final isCurrentTypeWallet = currency == walletStore.type;
|
||||
void _onCurrencyChange(CryptoCurrency currency,
|
||||
ExchangeViewModel exchangeViewModel, GlobalKey<ExchangeCardState> key) {
|
||||
final isCurrentTypeWallet = currency == exchangeViewModel.wallet.currency;
|
||||
|
||||
key.currentState.changeSelectedCurrency(currency);
|
||||
key.currentState
|
||||
.changeWalletName(isCurrentTypeWallet ? walletStore.name : null);
|
||||
key.currentState.changeWalletName(
|
||||
isCurrentTypeWallet ? exchangeViewModel.wallet.name : null);
|
||||
|
||||
key.currentState
|
||||
.changeAddress(address: isCurrentTypeWallet ? walletStore.address : '');
|
||||
key.currentState.changeAddress(
|
||||
address: isCurrentTypeWallet ? exchangeViewModel.wallet.address : '');
|
||||
|
||||
key.currentState.changeAmount(amount: '');
|
||||
}
|
||||
|
||||
void _onWalletNameChange(WalletStore walletStore, CryptoCurrency currency,
|
||||
GlobalKey<ExchangeCardState> key) {
|
||||
final isCurrentTypeWallet = currency == walletStore.type;
|
||||
void _onWalletNameChange(ExchangeViewModel exchangeViewModel,
|
||||
CryptoCurrency currency, GlobalKey<ExchangeCardState> key) {
|
||||
final isCurrentTypeWallet = currency == exchangeViewModel.wallet.currency;
|
||||
|
||||
if (isCurrentTypeWallet) {
|
||||
key.currentState.changeWalletName(walletStore.name);
|
||||
key.currentState.addressController.text = walletStore.address;
|
||||
} else if (key.currentState.addressController.text == walletStore.address) {
|
||||
key.currentState.changeWalletName(exchangeViewModel.wallet.name);
|
||||
key.currentState.addressController.text =
|
||||
exchangeViewModel.wallet.address;
|
||||
} else if (key.currentState.addressController.text ==
|
||||
exchangeViewModel.wallet.address) {
|
||||
key.currentState.changeWalletName(null);
|
||||
key.currentState.addressController.text = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import 'dart:ui';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_background.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
|
||||
|
||||
class CurrencyPicker extends StatelessWidget {
|
||||
CurrencyPicker({
|
||||
|
@ -16,104 +18,103 @@ class CurrencyPicker extends StatelessWidget {
|
|||
final List<CryptoCurrency> items;
|
||||
final String title;
|
||||
final Function(CryptoCurrency) onItemSelected;
|
||||
final closeButton = Image.asset('assets/images/close.png',
|
||||
color: Palette.darkBlueCraiola,
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)),
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: TextDecoration.none,
|
||||
color: Colors.white
|
||||
),
|
||||
return AlertBackground(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: TextDecoration.none,
|
||||
color: Colors.white
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
child: GestureDetector(
|
||||
onTap: () => null,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
child: Container(
|
||||
height: 400,
|
||||
width: 300,
|
||||
color: Theme.of(context).dividerColor,
|
||||
child: GridView.count(
|
||||
shrinkWrap: true,
|
||||
crossAxisCount: 3,
|
||||
childAspectRatio: 1.25,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
crossAxisSpacing: 1,
|
||||
mainAxisSpacing: 1,
|
||||
children: List.generate(15, (index) {
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
child: GestureDetector(
|
||||
onTap: () => null,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
child: Container(
|
||||
height: 400,
|
||||
width: 300,
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
child: GridView.count(
|
||||
shrinkWrap: true,
|
||||
crossAxisCount: 3,
|
||||
childAspectRatio: 1.25,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
crossAxisSpacing: 1,
|
||||
mainAxisSpacing: 1,
|
||||
children: List.generate(15, (index) {
|
||||
|
||||
if (index == 14) {
|
||||
return Container(
|
||||
color: Theme.of(context).primaryTextTheme.display1.color,
|
||||
);
|
||||
}
|
||||
if (index == 14) {
|
||||
return Container(
|
||||
color: Theme.of(context).accentTextTheme.title.color,
|
||||
);
|
||||
}
|
||||
|
||||
final item = items[index];
|
||||
final isItemSelected = index == selectedAtIndex;
|
||||
final item = items[index];
|
||||
final isItemSelected = index == selectedAtIndex;
|
||||
|
||||
final color = isItemSelected
|
||||
? Theme.of(context).accentTextTheme.subtitle.decorationColor
|
||||
: Theme.of(context).primaryTextTheme.display1.color;
|
||||
final textColor = isItemSelected
|
||||
? Colors.blue
|
||||
: Theme.of(context).primaryTextTheme.title.color;
|
||||
final color = isItemSelected
|
||||
? Theme.of(context).textTheme.body2.color
|
||||
: Theme.of(context).accentTextTheme.title.color;
|
||||
final textColor = isItemSelected
|
||||
? Palette.blueCraiola
|
||||
: Theme.of(context).primaryTextTheme.title.color;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (onItemSelected == null) {
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
onItemSelected(item);
|
||||
},
|
||||
child: Container(
|
||||
color: color,
|
||||
child: Center(
|
||||
child: Text(
|
||||
item.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: TextDecoration.none,
|
||||
color: textColor
|
||||
),
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (onItemSelected == null) {
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
onItemSelected(item);
|
||||
},
|
||||
child: Container(
|
||||
color: color,
|
||||
child: Center(
|
||||
child: Text(
|
||||
item.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
decoration: TextDecoration.none,
|
||||
color: textColor
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
})
|
||||
),
|
||||
),
|
||||
);
|
||||
})
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
AlertCloseButton(image: closeButton)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@ class ExchangeCard extends StatefulWidget {
|
|||
this.imageArrow,
|
||||
this.currencyButtonColor = Colors.transparent,
|
||||
this.addressButtonsColor = Colors.transparent,
|
||||
this.borderColor = Colors.transparent,
|
||||
this.currencyValueValidator,
|
||||
this.addressTextFieldValidator})
|
||||
: super(key: key);
|
||||
|
@ -37,6 +38,7 @@ class ExchangeCard extends StatefulWidget {
|
|||
final Image imageArrow;
|
||||
final Color currencyButtonColor;
|
||||
final Color addressButtonsColor;
|
||||
final Color borderColor;
|
||||
final FormFieldValidator<String> currencyValueValidator;
|
||||
final FormFieldValidator<String> addressTextFieldValidator;
|
||||
|
||||
|
@ -110,10 +112,15 @@ class ExchangeCardState extends State<ExchangeCard> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final copyImage = Image.asset('assets/images/copy_content.png',
|
||||
height: 16, width: 16,
|
||||
color: Theme.of(context).primaryTextTheme.display2.color);
|
||||
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
@ -123,13 +130,13 @@ class ExchangeCardState extends State<ExchangeCard> {
|
|||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color
|
||||
color: Theme.of(context).textTheme.headline.color
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
BaseTextFormField(
|
||||
|
@ -139,11 +146,25 @@ class ExchangeCardState extends State<ExchangeCard> {
|
|||
keyboardType: TextInputType.numberWithOptions(
|
||||
signed: false, decimal: true),
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(15),
|
||||
BlacklistingTextInputFormatter(
|
||||
RegExp('[\\-|\\ |\\,]'))
|
||||
],
|
||||
hintText: '0.0000',
|
||||
validator: widget.currencyValueValidator
|
||||
borderColor: widget.borderColor,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white
|
||||
),
|
||||
placeholderTextStyle: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).textTheme.subhead.decorationColor
|
||||
),
|
||||
validator: _isAmountEditable
|
||||
? widget.currencyValueValidator
|
||||
: null
|
||||
),
|
||||
Positioned(
|
||||
top: 8,
|
||||
|
@ -163,7 +184,7 @@ class ExchangeCardState extends State<ExchangeCard> {
|
|||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).primaryTextTheme.title.color)),
|
||||
color: Colors.white)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: widget.imageArrow,
|
||||
|
@ -181,45 +202,102 @@ class ExchangeCardState extends State<ExchangeCard> {
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
_min != null
|
||||
? Text(
|
||||
? Text(
|
||||
S.of(context).min_value(
|
||||
_min, _selectedCurrency.toString()),
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
height: 1.2,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color),
|
||||
color: Theme.of(context).textTheme.subhead.decorationColor),
|
||||
)
|
||||
: Offstage(),
|
||||
: Offstage(),
|
||||
_min != null ? SizedBox(width: 10) : Offstage(),
|
||||
_max != null
|
||||
? Text(
|
||||
? Text(
|
||||
S.of(context).max_value(
|
||||
_max, _selectedCurrency.toString()),
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
height: 1.2,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color))
|
||||
: Offstage(),
|
||||
color: Theme.of(context).textTheme.subhead.decorationColor))
|
||||
: Offstage(),
|
||||
]),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
_isAddressEditable
|
||||
? Offstage()
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Text(
|
||||
S.of(context).refund_address,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).textTheme.subhead.decorationColor
|
||||
),
|
||||
)
|
||||
),
|
||||
_isAddressEditable
|
||||
? Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: AddressTextField(
|
||||
controller: addressController,
|
||||
isActive: _isAddressEditable,
|
||||
options: _isAddressEditable
|
||||
? _walletName != null
|
||||
? []
|
||||
: [
|
||||
options: [
|
||||
AddressTextFieldOption.paste,
|
||||
AddressTextFieldOption.qrCode,
|
||||
AddressTextFieldOption.addressBook,
|
||||
]
|
||||
: [],
|
||||
],
|
||||
isBorderExist: false,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white),
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).textTheme.subhead.decorationColor),
|
||||
buttonColor: widget.addressButtonsColor,
|
||||
validator: widget.addressTextFieldValidator,
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: Builder(
|
||||
builder: (context) => GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: addressController.text));
|
||||
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: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
addressController.text,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 16),
|
||||
child: copyImage,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/stores/exchange/exchange_store.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_provider.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/widgets/picker.dart';
|
||||
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
|
||||
|
||||
class PresentProviderPicker extends StatelessWidget {
|
||||
PresentProviderPicker({@required this.exchangeStore});
|
||||
PresentProviderPicker({@required this.exchangeViewModel});
|
||||
|
||||
final ExchangeStore exchangeStore;
|
||||
final ExchangeViewModel exchangeViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Image arrowBottom =
|
||||
final arrowBottom =
|
||||
Image.asset('assets/images/arrow_bottom_purple_icon.png',
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
color: Colors.white,
|
||||
height: 6);
|
||||
|
||||
return FlatButton(
|
||||
|
@ -33,19 +33,19 @@ class PresentProviderPicker extends StatelessWidget {
|
|||
Text(S.of(context).exchange,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context).primaryTextTheme.title.color)),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white)),
|
||||
Observer(
|
||||
builder: (_) => Text('${exchangeStore.provider.title}',
|
||||
builder: (_) => Text('${exchangeViewModel.provider.title}',
|
||||
style: TextStyle(
|
||||
fontSize: 10.0,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color)))
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).textTheme.headline.color)))
|
||||
],
|
||||
),
|
||||
SizedBox(width: 5),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 8),
|
||||
padding: EdgeInsets.only(top: 12),
|
||||
child: arrowBottom,
|
||||
)
|
||||
],
|
||||
|
@ -54,11 +54,11 @@ class PresentProviderPicker extends StatelessWidget {
|
|||
}
|
||||
|
||||
void _presentProviderPicker(BuildContext context) {
|
||||
final items = exchangeStore.providersForCurrentPair();
|
||||
final selectedItem = items.indexOf(exchangeStore.provider);
|
||||
final images = List<Image>();
|
||||
final items = exchangeViewModel.providersForCurrentPair();
|
||||
final selectedItem = items.indexOf(exchangeViewModel.provider);
|
||||
final images = <Image>[];
|
||||
|
||||
for (ExchangeProvider provider in items) {
|
||||
for (var provider in items) {
|
||||
switch (provider.description) {
|
||||
case ExchangeProviderDescription.xmrto:
|
||||
images.add(Image.asset('assets/images/xmr_btc.png'));
|
||||
|
@ -79,7 +79,7 @@ class PresentProviderPicker extends StatelessWidget {
|
|||
selectedAtIndex: selectedItem,
|
||||
title: S.of(context).change_exchange_provider,
|
||||
onItemSelected: (ExchangeProvider provider) =>
|
||||
exchangeStore.changeProvider(provider: provider)),
|
||||
exchangeViewModel.changeProvider(provider: provider)),
|
||||
context: context);
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:cake_wallet/store/dashboard/trades_store.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
@ -6,10 +7,12 @@ 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:cake_wallet/src/domain/exchange/trade.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class ExchangeConfirmPage extends BasePage {
|
||||
ExchangeConfirmPage({@required this.trade});
|
||||
ExchangeConfirmPage({@required this.tradesStore}) : trade = tradesStore.trade;
|
||||
|
||||
final TradesStore tradesStore;
|
||||
final Trade trade;
|
||||
|
||||
@override
|
||||
|
@ -17,93 +20,102 @@ class ExchangeConfirmPage extends BasePage {
|
|||
|
||||
@override
|
||||
Widget body(BuildContext context) {
|
||||
final copyImage = Image.asset('assets/images/copy_content.png',
|
||||
color: Theme.of(context).primaryTextTheme.title.color);
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.all(24),
|
||||
padding: EdgeInsets.fromLTRB(24, 0, 24, 24),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).exchange_result_write_down_trade_id,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 60),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Center(
|
||||
child: Text(
|
||||
S.of(context).trade_id,
|
||||
S.of(context).exchange_result_write_down_trade_id,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
),
|
||||
)
|
||||
),
|
||||
Container(
|
||||
height: 178,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: Theme.of(context).accentTextTheme.caption.color
|
||||
),
|
||||
color: Theme.of(context).accentTextTheme.title.color
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
child: Builder(
|
||||
builder: (context) => GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: trade.id));
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
S.of(context).copied_to_clipboard,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: Colors.green,
|
||||
duration: Duration(milliseconds: 1500),
|
||||
));
|
||||
},
|
||||
child: Container(
|
||||
height: 60,
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(24),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
trade.id,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
Text(
|
||||
S.of(context).trade_id,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).primaryTextTheme.overline.color
|
||||
),
|
||||
),
|
||||
Text(
|
||||
trade.id,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 12),
|
||||
child: copyImage,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 0, 10, 10),
|
||||
child: Builder(
|
||||
builder: (context) => PrimaryButton(
|
||||
onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: trade.id));
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
S.of(context).copied_to_clipboard,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: Colors.green,
|
||||
duration: Duration(milliseconds: 1500),
|
||||
));
|
||||
},
|
||||
text: S.of(context).copy_id,
|
||||
color: Theme.of(context).accentTextTheme.caption.backgroundColor,
|
||||
textColor: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: Offstage()
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
PrimaryButton(
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.exchangeTrade, arguments: trade),
|
||||
.pushReplacementNamed(Routes.exchangeTrade),
|
||||
text: S.of(context).saved_the_trade_id,
|
||||
color: Colors.green,
|
||||
color: Palette.blueCraiola,
|
||||
textColor: Colors.white)
|
||||
],
|
||||
),
|
||||
|
|
13
lib/src/screens/exchange_trade/exchange_trade_item.dart
Normal file
|
@ -0,0 +1,13 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class ExchangeTradeItem {
|
||||
ExchangeTradeItem({
|
||||
@required this.title,
|
||||
@required this.data,
|
||||
@required this.isCopied,
|
||||
});
|
||||
|
||||
String title;
|
||||
String data;
|
||||
bool isCopied;
|
||||
}
|
|
@ -1,5 +1,10 @@
|
|||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_item.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart';
|
||||
import 'package:cake_wallet/src/widgets/standart_list_row.dart';
|
||||
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
|
@ -19,15 +24,62 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
|||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||
|
||||
void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
|
||||
final fetchingLabel = S.current.fetching;
|
||||
final trade = exchangeTradeViewModel.trade;
|
||||
final walletName = exchangeTradeViewModel.wallet.name;
|
||||
|
||||
final information = exchangeTradeViewModel.isSendable
|
||||
? S.current.exchange_result_confirm(
|
||||
trade.amount ?? fetchingLabel,
|
||||
trade.from.toString(),
|
||||
walletName)
|
||||
: S.current.exchange_result_description(
|
||||
trade.amount ?? fetchingLabel, trade.from.toString());
|
||||
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => InformationPage(information: information)
|
||||
);
|
||||
}
|
||||
|
||||
class ExchangeTradePage extends BasePage {
|
||||
ExchangeTradePage({@required this.exchangeTradeViewModel});
|
||||
|
||||
final ExchangeTradeViewModel exchangeTradeViewModel;
|
||||
|
||||
@override
|
||||
String get title => S.current.exchange;
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) => ExchangeTradeForm();
|
||||
Widget trailing(BuildContext context) {
|
||||
final questionImage = Image.asset('assets/images/question_mark.png',
|
||||
color: Theme.of(context).primaryTextTheme.title.color);
|
||||
|
||||
return SizedBox(
|
||||
height: 20.0,
|
||||
width: 20.0,
|
||||
child: ButtonTheme(
|
||||
minWidth: double.minPositive,
|
||||
child: FlatButton(
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
padding: EdgeInsets.all(0),
|
||||
onPressed: () => showInformation(exchangeTradeViewModel, context),
|
||||
child: questionImage),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) => ExchangeTradeForm(exchangeTradeViewModel);
|
||||
}
|
||||
|
||||
class ExchangeTradeForm extends StatefulWidget {
|
||||
ExchangeTradeForm(this.exchangeTradeViewModel);
|
||||
|
||||
final ExchangeTradeViewModel exchangeTradeViewModel;
|
||||
|
||||
@override
|
||||
ExchangeTradeState createState() => ExchangeTradeState();
|
||||
}
|
||||
|
@ -39,263 +91,139 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
|||
bool _effectsInstalled = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tradeStore = Provider.of<ExchangeTradeStore>(context);
|
||||
final sendStore = Provider.of<SendStore>(context);
|
||||
final walletStore = Provider.of<WalletStore>(context);
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback(afterLayout);
|
||||
}
|
||||
|
||||
_setEffects(context);
|
||||
void afterLayout(dynamic _) {
|
||||
showInformation(widget.exchangeTradeViewModel, context);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final copyImage = Image.asset('assets/images/copy_content.png',
|
||||
height: 16, width: 16,
|
||||
color: Theme.of(context).primaryTextTheme.overline.color);
|
||||
|
||||
//_setEffects(context);
|
||||
|
||||
return Container(
|
||||
child: ScrollableWithBottomSection(
|
||||
contentPadding: EdgeInsets.only(left: 24, right: 24, top: 24),
|
||||
contentPadding: EdgeInsets.only(top: 10, bottom: 16),
|
||||
content: Observer(builder: (_) {
|
||||
final trade = tradeStore.trade;
|
||||
final walletName = walletStore.name;
|
||||
final trade = widget.exchangeTradeViewModel.trade;
|
||||
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).id,
|
||||
style: TextStyle(
|
||||
height: 2,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
),
|
||||
Text(
|
||||
'${trade.id ?? fetchingLabel}',
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
height: 2,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).amount,
|
||||
style: TextStyle(
|
||||
height: 2,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
),
|
||||
Text(
|
||||
'${trade.amount ?? fetchingLabel}',
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
height: 2,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color),
|
||||
)
|
||||
],
|
||||
),
|
||||
trade.extraId != null
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).payment_id,
|
||||
style: TextStyle(
|
||||
height: 2,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
),
|
||||
Text(
|
||||
'${trade.extraId ?? fetchingLabel}',
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
height: 2,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color),
|
||||
)
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).status,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
height: 2),
|
||||
),
|
||||
Text(
|
||||
'${trade.state ?? fetchingLabel}',
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
height: 2,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color),
|
||||
)
|
||||
],
|
||||
),
|
||||
trade.expiredAt != null
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).offer_expires_in,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
),
|
||||
TimerWidget(trade.expiredAt,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color)
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
trade.expiredAt != null
|
||||
? Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).offer_expires_in,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).primaryTextTheme.overline.color),
|
||||
),
|
||||
TimerWidget(trade.expiredAt,
|
||||
color: Theme.of(context).primaryTextTheme.title.color)
|
||||
])
|
||||
: Offstage(),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 32),
|
||||
child: Row(children: <Widget>[
|
||||
Spacer(flex: 3),
|
||||
Flexible(
|
||||
flex: 4,
|
||||
child: Center(
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1.0,
|
||||
child: QrImage(
|
||||
data: trade.inputAddress ?? fetchingLabel,
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: Theme.of(context)
|
||||
.accentTextTheme.subtitle.color,
|
||||
)))),
|
||||
Spacer(flex: 3)
|
||||
]),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Spacer(
|
||||
flex: 1,
|
||||
),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: Center(
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1.0,
|
||||
child: QrImage(
|
||||
data: trade.inputAddress ?? fetchingLabel,
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: Theme.of(context).primaryTextTheme.display4.color,
|
||||
),
|
||||
),
|
||||
)),
|
||||
Spacer(
|
||||
flex: 1,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.0,
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
S.of(context).trade_is_powered_by(trade.provider != null
|
||||
? trade.provider.title
|
||||
: fetchingLabel),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 20, bottom: 20),
|
||||
child: Center(
|
||||
child: Text(
|
||||
trade.inputAddress ?? fetchingLabel,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color),
|
||||
padding: EdgeInsets.only(top: 16),
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: widget.exchangeTradeViewModel.items.length,
|
||||
separatorBuilder: (context, index) => Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).accentTextTheme.subtitle.backgroundColor,
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
final item = widget.exchangeTradeViewModel.items[index];
|
||||
String value;
|
||||
|
||||
final content = Observer(
|
||||
builder: (_) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
value = '${widget.exchangeTradeViewModel.trade.id ?? fetchingLabel}';
|
||||
break;
|
||||
case 1:
|
||||
value = '${widget.exchangeTradeViewModel.trade.amount ?? fetchingLabel}';
|
||||
break;
|
||||
case 2:
|
||||
value = '${widget.exchangeTradeViewModel.trade.state ?? fetchingLabel}';
|
||||
break;
|
||||
case 3:
|
||||
value = widget.exchangeTradeViewModel.trade.inputAddress ?? fetchingLabel;
|
||||
break;
|
||||
}
|
||||
|
||||
return StandartListRow(
|
||||
title: item.title,
|
||||
value: value,
|
||||
valueFontSize: 14,
|
||||
image: item.isCopied ? copyImage : null,
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
return item.isCopied
|
||||
? Builder(
|
||||
builder: (context) =>
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: value));
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
S.of(context).copied_to_clipboard,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: Colors.green,
|
||||
duration: Duration(milliseconds: 1500),
|
||||
));
|
||||
},
|
||||
child: content,
|
||||
)
|
||||
)
|
||||
: content;
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(right: 5.0),
|
||||
child: Builder(
|
||||
builder: (context) => PrimaryButton(
|
||||
onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: trade.inputAddress));
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
S.of(context).copied_to_clipboard,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: Colors.green,
|
||||
duration: Duration(milliseconds: 1500),
|
||||
));
|
||||
},
|
||||
text: S.of(context).copy_address,
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
textColor: Theme.of(context).primaryTextTheme.title.color)
|
||||
),
|
||||
)),
|
||||
Flexible(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 5.0),
|
||||
child: Builder(
|
||||
builder: (context) => PrimaryButton(
|
||||
onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: trade.id));
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
S.of(context).copied_to_clipboard,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: Colors.green,
|
||||
duration: Duration(milliseconds: 1500),
|
||||
));
|
||||
},
|
||||
text: S.of(context).copy_id,
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
textColor: Theme.of(context).primaryTextTheme.title.color)
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Text(
|
||||
tradeStore.isSendable
|
||||
? S.of(context).exchange_result_confirm(
|
||||
trade.amount ?? fetchingLabel,
|
||||
trade.from.toString(),
|
||||
walletName)
|
||||
: S.of(context).exchange_result_description(
|
||||
trade.amount ?? fetchingLabel, trade.from.toString()),
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
S.of(context).exchange_result_write_down_ID,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
)
|
||||
],
|
||||
);
|
||||
}),
|
||||
bottomSectionPadding: EdgeInsets.all(24),
|
||||
bottomSection: Observer(
|
||||
bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24),
|
||||
bottomSection: PrimaryButton(
|
||||
onPressed: () {},
|
||||
text: S.of(context).confirm,
|
||||
color: Palette.blueCraiola,
|
||||
textColor: Colors.white
|
||||
)
|
||||
/*Observer(
|
||||
builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr &&
|
||||
!(sendStore.state is TransactionCommitted)
|
||||
? LoadingPrimaryButton(
|
||||
|
@ -312,7 +240,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
|||
: S.of(context).send_xmr,
|
||||
color: Colors.blue,
|
||||
textColor: Colors.white)
|
||||
: Offstage()),
|
||||
: Offstage()),*/
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -322,7 +250,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
|||
return;
|
||||
}
|
||||
|
||||
final sendStore = Provider.of<SendStore>(context);
|
||||
/*final sendStore = Provider.of<SendStore>(context);
|
||||
|
||||
reaction((_) => sendStore.state, (SendingState state) {
|
||||
if (state is SendingFailed) {
|
||||
|
@ -376,7 +304,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
|||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
_effectsInstalled = true;
|
||||
}
|
||||
|
|
57
lib/src/screens/exchange_trade/information_page.dart
Normal file
|
@ -0,0 +1,57 @@
|
|||
import 'dart:ui';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_background.dart';
|
||||
|
||||
class InformationPage extends StatelessWidget {
|
||||
InformationPage({@required this.information});
|
||||
|
||||
final String information;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertBackground(
|
||||
child: Center(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 24,
|
||||
right: 24
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
color: Theme.of(context).textTheme.body2.decorationColor
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.fromLTRB(24, 28, 24, 24),
|
||||
child: Text(
|
||||
information,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.normal,
|
||||
fontFamily: 'Poppins',
|
||||
decoration: TextDecoration.none,
|
||||
color: Theme.of(context).accentTextTheme.caption.decorationColor
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 0, 10, 10),
|
||||
child: PrimaryButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
text: S.of(context).send_got_it,
|
||||
color: Theme.of(context).accentTextTheme.caption.backgroundColor,
|
||||
textColor: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -53,10 +53,16 @@ class TimerWidgetState extends State<TimerWidget> {
|
|||
Widget build(BuildContext context) {
|
||||
return _isExpired
|
||||
? Text(S.of(context).expired,
|
||||
style: TextStyle(fontSize: 14.0, color: Colors.red))
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.red))
|
||||
: Text(
|
||||
S.of(context).time(_minutes.toString(), _seconds.toString()),
|
||||
style: TextStyle(fontSize: 14.0, color: widget.color),
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: widget.color),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import 'package:cake_wallet/view_model/monero_account_list/monero_account_edit_o
|
|||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class MoneroAccountEditOrCreatePage extends BasePage {
|
||||
MoneroAccountEditOrCreatePage({@required this.moneroAccountCreationViewModel})
|
||||
|
@ -24,12 +23,6 @@ class MoneroAccountEditOrCreatePage extends BasePage {
|
|||
@override
|
||||
String get title => S.current.account;
|
||||
|
||||
@override
|
||||
Color get backgroundLightColor => PaletteDark.backgroundColor;
|
||||
|
||||
@override
|
||||
Color get backgroundDarkColor => PaletteDark.backgroundColor;
|
||||
|
||||
final GlobalKey<FormState> _formKey;
|
||||
final TextEditingController _textController;
|
||||
|
||||
|
@ -45,7 +38,6 @@ class MoneroAccountEditOrCreatePage extends BasePage {
|
|||
child: Center(
|
||||
child: BaseTextFormField(
|
||||
controller: _textController,
|
||||
textColor: Colors.white,
|
||||
hintText: S.of(context).account,
|
||||
validator: MoneroLabelValidator(),
|
||||
))),
|
||||
|
|
|
@ -27,7 +27,9 @@ class MoneroAccountListPage extends StatelessWidget {
|
|||
}
|
||||
|
||||
final MoneroAccountListViewModel accountListViewModel;
|
||||
final closeIcon = Image.asset('assets/images/close.png');
|
||||
final closeIcon = Image.asset('assets/images/close.png',
|
||||
color: Palette.darkBlueCraiola,
|
||||
);
|
||||
|
||||
ScrollController controller;
|
||||
double backgroundHeight;
|
||||
|
@ -64,7 +66,7 @@ class MoneroAccountListPage extends StatelessWidget {
|
|||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
child: Container(
|
||||
height: 296,
|
||||
color: PaletteDark.deepPurpleBlue,
|
||||
color: Theme.of(context).textTheme.display4.decorationColor,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
|
@ -83,7 +85,7 @@ class MoneroAccountListPage extends StatelessWidget {
|
|||
separatorBuilder: (context, index) =>
|
||||
Container(
|
||||
height: 1,
|
||||
color: PaletteDark.dividerColor,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
itemCount: accounts.length ?? 0,
|
||||
itemBuilder: (context, index) {
|
||||
|
@ -121,7 +123,7 @@ class MoneroAccountListPage extends StatelessWidget {
|
|||
.pushNamed(Routes.accountCreation),
|
||||
child: Container(
|
||||
height: 62,
|
||||
color: Colors.white,
|
||||
color: Theme.of(context).textTheme.subtitle.decorationColor,
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
child: Center(
|
||||
child: Row(
|
||||
|
@ -129,7 +131,7 @@ class MoneroAccountListPage extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Icon(
|
||||
Icons.add,
|
||||
color: PaletteDark.darkNightBlue,
|
||||
color: Colors.white,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
|
@ -138,7 +140,7 @@ class MoneroAccountListPage extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: PaletteDark.darkNightBlue,
|
||||
color: Colors.white,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class AccountTile extends StatelessWidget {
|
||||
AccountTile({
|
||||
|
@ -14,8 +13,12 @@ class AccountTile extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = isCurrent ? PaletteDark.lightOceanBlue : Colors.transparent;
|
||||
final textColor = isCurrent ? Colors.blue : Colors.white;
|
||||
final color = isCurrent
|
||||
? Theme.of(context).textTheme.subtitle.decorationColor
|
||||
: Theme.of(context).textTheme.display4.decorationColor;
|
||||
final textColor = isCurrent
|
||||
? Theme.of(context).textTheme.subtitle.color
|
||||
: Theme.of(context).textTheme.display4.color;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
|
|
|
@ -14,7 +14,6 @@ import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_h
|
|||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_item.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||
import 'package:cake_wallet/src/screens/receive/widgets/qr_widget.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class ReceivePage extends BasePage {
|
||||
ReceivePage({this.addressListViewModel});
|
||||
|
@ -25,10 +24,26 @@ class ReceivePage extends BasePage {
|
|||
String get title => S.current.receive;
|
||||
|
||||
@override
|
||||
Color get backgroundLightColor => PaletteDark.backgroundColor;
|
||||
Color get backgroundLightColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
Color get backgroundDarkColor => PaletteDark.backgroundColor;
|
||||
Color get backgroundDarkColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
Color get titleColor => Colors.white;
|
||||
|
||||
@override
|
||||
Widget Function(BuildContext, Widget) get rootWrapper =>
|
||||
(BuildContext context, Widget scaffold) => Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(colors: [
|
||||
Theme.of(context).accentColor,
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
Theme.of(context).primaryColor,
|
||||
],
|
||||
begin: Alignment.topRight,
|
||||
end: Alignment.bottomLeft)),
|
||||
child: scaffold);
|
||||
|
||||
@override
|
||||
Widget trailing(BuildContext context) {
|
||||
|
@ -66,7 +81,9 @@ class ReceivePage extends BasePage {
|
|||
Observer(
|
||||
builder: (_) => ListView.separated(
|
||||
separatorBuilder: (context, _) =>
|
||||
Container(height: 1, color: PaletteDark.dividerColor),
|
||||
Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor),
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: addressListViewModel.items.length,
|
||||
|
@ -83,7 +100,7 @@ class ReceivePage extends BasePage {
|
|||
icon: Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 14,
|
||||
color: Colors.white,
|
||||
color: Theme.of(context).textTheme.display1.color,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -95,7 +112,7 @@ class ReceivePage extends BasePage {
|
|||
icon: Icon(
|
||||
Icons.add,
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
color: Theme.of(context).textTheme.display1.color,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -105,11 +122,11 @@ class ReceivePage extends BasePage {
|
|||
final isCurrent = item.address ==
|
||||
addressListViewModel.address.address;
|
||||
final backgroundColor = isCurrent
|
||||
? PaletteDark.lightOceanBlue
|
||||
: PaletteDark.nightBlue;
|
||||
? Theme.of(context).textTheme.display3.decorationColor
|
||||
: Theme.of(context).textTheme.display2.decorationColor;
|
||||
final textColor = isCurrent
|
||||
? Colors.blue
|
||||
: Colors.white;
|
||||
? Theme.of(context).textTheme.display3.color
|
||||
: Theme.of(context).textTheme.display2.color;
|
||||
|
||||
return AddressCell.fromItem(item,
|
||||
isCurrent: isCurrent,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class HeaderTile extends StatelessWidget {
|
||||
HeaderTile({
|
||||
|
@ -23,7 +22,7 @@ class HeaderTile extends StatelessWidget {
|
|||
top: 24,
|
||||
bottom: 24
|
||||
),
|
||||
color: PaletteDark.nightBlue,
|
||||
color: Theme.of(context).textTheme.display2.decorationColor,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
|
@ -32,8 +31,8 @@ class HeaderTile extends StatelessWidget {
|
|||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).textTheme.display2.color
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
@ -41,7 +40,7 @@ class HeaderTile extends StatelessWidget {
|
|||
width: 32,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: PaletteDark.distantNightBlue
|
||||
color: Theme.of(context).textTheme.display1.decorationColor
|
||||
),
|
||||
child: icon,
|
||||
)
|
||||
|
|
|
@ -7,7 +7,6 @@ import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
|
|||
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
|
||||
import 'package:cake_wallet/core/amount_validator.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class QRWidget extends StatelessWidget {
|
||||
QRWidget({
|
||||
|
@ -27,7 +26,7 @@ class QRWidget extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final copyImage = Image.asset('assets/images/copy_address.png',
|
||||
color: PaletteDark.lightBlueGrey);
|
||||
color: Theme.of(context).textTheme.subhead.decorationColor);
|
||||
final addressTopOffset = isAmountFieldShow ? 60.0 : 40.0;
|
||||
|
||||
return Column(
|
||||
|
@ -45,7 +44,7 @@ class QRWidget extends StatelessWidget {
|
|||
child: QrImage(
|
||||
data: addressListViewModel.uri.toString(),
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: PaletteDark.lightBlueGrey,
|
||||
foregroundColor: Theme.of(context).textTheme.headline.color,
|
||||
))))),
|
||||
Spacer(flex: 3)
|
||||
]),
|
||||
|
@ -56,7 +55,7 @@ class QRWidget extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: PaletteDark.cyanBlue
|
||||
color: Theme.of(context).indicatorColor
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -79,13 +78,14 @@ class QRWidget extends StatelessWidget {
|
|||
textAlign: TextAlign.center,
|
||||
hintText: S.of(context).receive_amount,
|
||||
textColor: Colors.white,
|
||||
borderColor: PaletteDark.darkGrey,
|
||||
borderColor: Theme.of(context).textTheme.headline.decorationColor,
|
||||
validator: AmountValidator(
|
||||
type: addressListViewModel.type
|
||||
type: addressListViewModel.type,
|
||||
isAutovalidate: true
|
||||
),
|
||||
autovalidate: true,
|
||||
placeholderTextStyle: TextStyle(
|
||||
color: PaletteDark.cyanBlue,
|
||||
color: Theme.of(context).hoverColor,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500))))
|
||||
],
|
||||
|
|
|
@ -1,277 +1,47 @@
|
|||
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/widgets/address_text_field.dart';
|
||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/src/stores/settings/settings_store.dart';
|
||||
import 'package:cake_wallet/src/stores/balance/balance_store.dart';
|
||||
import 'package:cake_wallet/src/stores/send/send_store.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/widgets/top_panel.dart';
|
||||
import 'package:cake_wallet/src/stores/send_template/send_template_store.dart';
|
||||
import 'package:cake_wallet/view_model/send_view_model.dart';
|
||||
import 'package:cake_wallet/src/screens/send/widgets/base_send_widget.dart';
|
||||
|
||||
class SendTemplatePage extends BasePage {
|
||||
@override
|
||||
String get title => S.current.send_title;
|
||||
SendTemplatePage({@required this.sendViewModel});
|
||||
|
||||
final SendViewModel sendViewModel;
|
||||
|
||||
@override
|
||||
Color get backgroundLightColor => Palette.lavender;
|
||||
String get title => S.current.exchange_new_template;
|
||||
|
||||
@override
|
||||
Color get backgroundDarkColor => PaletteDark.lightNightBlue;
|
||||
Color get titleColor => Colors.white;
|
||||
|
||||
@override
|
||||
Color get backgroundLightColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
Color get backgroundDarkColor => Colors.transparent;
|
||||
|
||||
@override
|
||||
bool get resizeToAvoidBottomPadding => false;
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) => SendTemplateForm();
|
||||
}
|
||||
|
||||
class SendTemplateForm extends StatefulWidget {
|
||||
@override
|
||||
SendTemplateFormState createState() => SendTemplateFormState();
|
||||
}
|
||||
|
||||
class SendTemplateFormState extends State<SendTemplateForm> {
|
||||
final _nameController = TextEditingController();
|
||||
final _addressController = TextEditingController();
|
||||
final _cryptoAmountController = TextEditingController();
|
||||
final _fiatAmountController = TextEditingController();
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
bool _effectsInstalled = false;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_nameController.dispose();
|
||||
_addressController.dispose();
|
||||
_cryptoAmountController.dispose();
|
||||
_fiatAmountController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
Widget body(BuildContext context) =>
|
||||
BaseSendWidget(
|
||||
sendViewModel: sendViewModel,
|
||||
leading: leading(context),
|
||||
middle: middle(context),
|
||||
isTemplate: true
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final settingsStore = Provider.of<SettingsStore>(context);
|
||||
final balanceStore = Provider.of<BalanceStore>(context);
|
||||
final sendStore = Provider.of<SendStore>(context);
|
||||
sendStore.settingsStore = settingsStore;
|
||||
final sendTemplateStore = Provider.of<SendTemplateStore>(context);
|
||||
|
||||
_setEffects(context);
|
||||
|
||||
return Container(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: ScrollableWithBottomSection(
|
||||
contentPadding: EdgeInsets.only(bottom: 24),
|
||||
content: Column(
|
||||
children: <Widget>[
|
||||
TopPanel(
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
widget: Form(
|
||||
key: _formKey,
|
||||
child: Column(children: <Widget>[
|
||||
TextFormField(
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
controller: _nameController,
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color),
|
||||
hintText: S.of(context).send_name,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 1.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 1.0))),
|
||||
validator: (value) {
|
||||
sendTemplateStore.validateTemplate(value);
|
||||
return sendTemplateStore.errorMessage;
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: AddressTextField(
|
||||
controller: _addressController,
|
||||
placeholder: S.of(context).send_monero_address,
|
||||
onURIScanned: (uri) {
|
||||
var address = '';
|
||||
var amount = '';
|
||||
|
||||
if (uri != null) {
|
||||
address = uri.path;
|
||||
amount = uri.queryParameters['tx_amount'];
|
||||
} else {
|
||||
address = uri.toString();
|
||||
}
|
||||
|
||||
_addressController.text = address;
|
||||
_cryptoAmountController.text = amount;
|
||||
},
|
||||
options: [
|
||||
AddressTextFieldOption.qrCode,
|
||||
AddressTextFieldOption.addressBook
|
||||
],
|
||||
buttonColor: Theme.of(context).accentTextTheme.title.color,
|
||||
validator: (value) {
|
||||
sendTemplateStore.validateTemplate(value);
|
||||
return sendTemplateStore.errorMessage;
|
||||
},
|
||||
),
|
||||
),
|
||||
Observer(
|
||||
builder: (_) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: TextFormField(
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
controller: _cryptoAmountController,
|
||||
keyboardType: TextInputType.numberWithOptions(
|
||||
signed: false, decimal: true),
|
||||
inputFormatters: [
|
||||
BlacklistingTextInputFormatter(
|
||||
RegExp('[\\-|\\ |\\,]'))
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Padding(
|
||||
padding: EdgeInsets.only(top: 12),
|
||||
child: Text('XMR:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
)),
|
||||
),
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
hintText: '0.0000',
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 1.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 1.0))),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: TextFormField(
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
controller: _fiatAmountController,
|
||||
keyboardType: TextInputType.numberWithOptions(
|
||||
signed: false, decimal: true),
|
||||
inputFormatters: [
|
||||
BlacklistingTextInputFormatter(
|
||||
RegExp('[\\-|\\ |\\,]'))
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Padding(
|
||||
padding: EdgeInsets.only(top: 12),
|
||||
child: Text(
|
||||
'${settingsStore.fiatCurrency.toString()}:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
)),
|
||||
),
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color),
|
||||
hintText: '0.00',
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 1.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 1.0)))),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
|
||||
bottomSection: PrimaryButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
sendTemplateStore.addTemplate(
|
||||
name: _nameController.text,
|
||||
address: _addressController.text,
|
||||
cryptoCurrency: 'XMR',
|
||||
amount: _cryptoAmountController.text
|
||||
);
|
||||
sendTemplateStore.update();
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
text: S.of(context).save,
|
||||
color: Colors.blue,
|
||||
textColor: Colors.white
|
||||
),
|
||||
),
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
|
||||
body: Container(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: body(context)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void _setEffects(BuildContext context) {
|
||||
if (_effectsInstalled) {
|
||||
return;
|
||||
}
|
||||
|
||||
final sendStore = Provider.of<SendStore>(context);
|
||||
|
||||
reaction((_) => sendStore.fiatAmount, (String amount) {
|
||||
if (amount != _fiatAmountController.text) {
|
||||
_fiatAmountController.text = amount;
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => sendStore.cryptoAmount, (String amount) {
|
||||
if (amount != _cryptoAmountController.text) {
|
||||
_cryptoAmountController.text = amount;
|
||||
}
|
||||
});
|
||||
|
||||
_fiatAmountController.addListener(() {
|
||||
final fiatAmount = _fiatAmountController.text;
|
||||
|
||||
if (sendStore.fiatAmount != fiatAmount) {
|
||||
sendStore.changeFiatAmount(fiatAmount);
|
||||
}
|
||||
});
|
||||
|
||||
_cryptoAmountController.addListener(() {
|
||||
final cryptoAmount = _cryptoAmountController.text;
|
||||
|
||||
if (sendStore.cryptoAmount != cryptoAmount) {
|
||||
sendStore.changeCryptoAmount(cryptoAmount);
|
||||
}
|
||||
});
|
||||
|
||||
_effectsInstalled = true;
|
||||
}
|
||||
}
|
578
lib/src/screens/send/widgets/base_send_widget.dart
Normal file
|
@ -0,0 +1,578 @@
|
|||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/view_model/send_view_model.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/widgets/address_text_field.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/widgets/top_panel.dart';
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||
import 'package:cake_wallet/src/screens/send/widgets/confirm_sending_alert.dart';
|
||||
import 'package:cake_wallet/src/screens/send/widgets/sending_alert.dart';
|
||||
import 'package:cake_wallet/src/widgets/template_tile.dart';
|
||||
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
|
||||
class BaseSendWidget extends StatelessWidget {
|
||||
BaseSendWidget({
|
||||
@required this.sendViewModel,
|
||||
@required this.leading,
|
||||
@required this.middle,
|
||||
this.isTemplate = false
|
||||
});
|
||||
|
||||
final SendViewModel sendViewModel;
|
||||
final bool isTemplate;
|
||||
final Widget leading;
|
||||
final Widget middle;
|
||||
|
||||
final _addressController = TextEditingController();
|
||||
final _cryptoAmountController = TextEditingController();
|
||||
final _fiatAmountController = TextEditingController();
|
||||
final _nameController = TextEditingController();
|
||||
final _focusNode = FocusNode();
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
bool _effectsInstalled = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
_setEffects(context);
|
||||
|
||||
return ScrollableWithBottomSection(
|
||||
contentPadding: EdgeInsets.only(bottom: 24),
|
||||
content: Column(
|
||||
children: <Widget>[
|
||||
TopPanel(
|
||||
edgeInsets: EdgeInsets.all(0),
|
||||
gradient: LinearGradient(colors: [
|
||||
Theme.of(context).primaryTextTheme.subhead.color,
|
||||
Theme.of(context).primaryTextTheme.subhead.decorationColor,
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight),
|
||||
widget: Form(
|
||||
key: _formKey,
|
||||
child: Column(children: <Widget>[
|
||||
CupertinoNavigationBar(
|
||||
leading: leading,
|
||||
middle: middle,
|
||||
backgroundColor: Colors.transparent,
|
||||
border: null,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(24, 24, 24, 32),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
isTemplate
|
||||
? BaseTextFormField(
|
||||
controller: _nameController,
|
||||
hintText: S.of(context).send_name,
|
||||
borderColor: Theme.of(context).primaryTextTheme.headline.color,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white
|
||||
),
|
||||
placeholderTextStyle: TextStyle(
|
||||
color: Theme.of(context).primaryTextTheme.headline.decorationColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14),
|
||||
validator: sendViewModel.templateValidator,
|
||||
)
|
||||
: Offstage(),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: isTemplate ? 20 : 0),
|
||||
child: AddressTextField(
|
||||
controller: _addressController,
|
||||
placeholder: S.of(context).send_address(
|
||||
sendViewModel.cryptoCurrencyTitle),
|
||||
focusNode: _focusNode,
|
||||
onURIScanned: (uri) {
|
||||
var address = '';
|
||||
var amount = '';
|
||||
|
||||
if (uri != null) {
|
||||
address = uri.path;
|
||||
amount = uri.queryParameters['tx_amount'];
|
||||
} else {
|
||||
address = uri.toString();
|
||||
}
|
||||
|
||||
_addressController.text = address;
|
||||
_cryptoAmountController.text = amount;
|
||||
},
|
||||
options: [
|
||||
AddressTextFieldOption.paste,
|
||||
AddressTextFieldOption.qrCode,
|
||||
AddressTextFieldOption.addressBook
|
||||
],
|
||||
buttonColor: Theme.of(context).primaryTextTheme.display1.color,
|
||||
borderColor: Theme.of(context).primaryTextTheme.headline.color,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white
|
||||
),
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).primaryTextTheme.headline.decorationColor
|
||||
),
|
||||
validator: sendViewModel.addressValidator,
|
||||
),
|
||||
),
|
||||
Observer(
|
||||
builder: (_) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: BaseTextFormField(
|
||||
controller: _cryptoAmountController,
|
||||
keyboardType: TextInputType.numberWithOptions(
|
||||
signed: false, decimal: true),
|
||||
inputFormatters: [
|
||||
BlacklistingTextInputFormatter(
|
||||
RegExp('[\\-|\\ |\\,]'))
|
||||
],
|
||||
prefixIcon: Padding(
|
||||
padding: EdgeInsets.only(top: 9),
|
||||
child: Text(sendViewModel.currency.title + ':',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
)),
|
||||
),
|
||||
suffixIcon: isTemplate
|
||||
? Offstage()
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(bottom: 2),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width/2,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
' / ' + sendViewModel.balance,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).primaryTextTheme.headline.decorationColor
|
||||
)
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 34,
|
||||
width: 34,
|
||||
margin: EdgeInsets.only(left: 12, bottom: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryTextTheme.display1.color,
|
||||
borderRadius: BorderRadius.all(Radius.circular(6))
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () => sendViewModel.setSendAll(),
|
||||
child: Center(
|
||||
child: Text(S.of(context).all,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).primaryTextTheme.display1.decorationColor
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
hintText: '0.0000',
|
||||
borderColor: Theme.of(context).primaryTextTheme.headline.color,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white
|
||||
),
|
||||
placeholderTextStyle: TextStyle(
|
||||
color: Theme.of(context).primaryTextTheme.headline.decorationColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14),
|
||||
validator: sendViewModel.amountValidator
|
||||
)
|
||||
);
|
||||
}
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: BaseTextFormField(
|
||||
controller: _fiatAmountController,
|
||||
keyboardType: TextInputType.numberWithOptions(
|
||||
signed: false, decimal: true),
|
||||
inputFormatters: [
|
||||
BlacklistingTextInputFormatter(
|
||||
RegExp('[\\-|\\ |\\,]'))
|
||||
],
|
||||
prefixIcon: Padding(
|
||||
padding: EdgeInsets.only(top: 9),
|
||||
child: Text(
|
||||
sendViewModel.fiat.title + ':',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
)),
|
||||
),
|
||||
hintText: '0.00',
|
||||
borderColor: Theme.of(context).primaryTextTheme.headline.color,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white
|
||||
),
|
||||
placeholderTextStyle: TextStyle(
|
||||
color: Theme.of(context).primaryTextTheme.headline.decorationColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14),
|
||||
)
|
||||
),
|
||||
isTemplate
|
||||
? Offstage()
|
||||
: GestureDetector(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Text(S.of(context).send_estimated_fee,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
//color: Theme.of(context).primaryTextTheme.display2.color,
|
||||
color: Colors.white
|
||||
)),
|
||||
Container(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
sendViewModel.estimatedFee.toString() + ' '
|
||||
+ sendViewModel.currency.title,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
//color: Theme.of(context).primaryTextTheme.display2.color,
|
||||
color: Colors.white
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 12,
|
||||
color: Colors.white,),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
isTemplate
|
||||
? Offstage()
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30,
|
||||
left: 24,
|
||||
bottom: 24
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).send_templates,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.display4.color
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
isTemplate
|
||||
? Offstage()
|
||||
: Container(
|
||||
height: 40,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
onTap: () => Navigator.of(context)
|
||||
.pushNamed(Routes.sendTemplate),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 1, right: 10),
|
||||
child: DottedBorder(
|
||||
borderType: BorderType.RRect,
|
||||
dashPattern: [6, 4],
|
||||
color: Theme.of(context).primaryTextTheme.display2.decorationColor,
|
||||
strokeWidth: 2,
|
||||
radius: Radius.circular(20),
|
||||
child: Container(
|
||||
height: 34,
|
||||
width: 75,
|
||||
padding: EdgeInsets.only(left: 10, right: 10),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: Text(
|
||||
S.of(context).send_new,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.display3.color
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
Observer(
|
||||
builder: (_) {
|
||||
final templates = sendViewModel.templates;
|
||||
final itemCount = templates.length;
|
||||
|
||||
return ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: itemCount,
|
||||
itemBuilder: (context, index) {
|
||||
final template = templates[index];
|
||||
|
||||
return TemplateTile(
|
||||
key: UniqueKey(),
|
||||
to: template.name,
|
||||
amount: template.amount,
|
||||
from: template.cryptoCurrency,
|
||||
onTap: () {
|
||||
_addressController.text = template.address;
|
||||
_cryptoAmountController.text = template.amount;
|
||||
getOpenaliasRecord(context);
|
||||
},
|
||||
onRemove: () {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (dialogContext) {
|
||||
return AlertWithTwoActions(
|
||||
alertTitle: S.of(context).template,
|
||||
alertContent: S.of(context).confirm_delete_template,
|
||||
leftButtonText: S.of(context).delete,
|
||||
rightButtonText: S.of(context).cancel,
|
||||
actionLeftButton: () {
|
||||
Navigator.of(dialogContext).pop();
|
||||
sendViewModel.sendTemplateStore.remove(template: template);
|
||||
sendViewModel.sendTemplateStore.update();
|
||||
},
|
||||
actionRightButton: () => Navigator.of(dialogContext).pop()
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
|
||||
bottomSection: isTemplate
|
||||
? PrimaryButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
sendViewModel.sendTemplateStore.addTemplate(
|
||||
name: _nameController.text,
|
||||
address: _addressController.text,
|
||||
cryptoCurrency: sendViewModel.currency.title,
|
||||
amount: _cryptoAmountController.text
|
||||
);
|
||||
sendViewModel.sendTemplateStore.update();
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
text: S.of(context).save,
|
||||
color: Colors.green,
|
||||
textColor: Colors.white)
|
||||
: Observer(builder: (_) {
|
||||
return LoadingPrimaryButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
print('SENT!!!');
|
||||
}
|
||||
},
|
||||
text: S.of(context).send,
|
||||
color: Palette.blueCraiola,
|
||||
textColor: Colors.white,
|
||||
isLoading: sendViewModel.state is TransactionIsCreating ||
|
||||
sendViewModel.state is TransactionCommitting,
|
||||
isDisabled:
|
||||
false // FIXME !(syncStore.status is SyncedSyncStatus),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
void _setEffects(BuildContext context) {
|
||||
if (_effectsInstalled) {
|
||||
return;
|
||||
}
|
||||
|
||||
reaction((_) => sendViewModel.fiatAmount, (String amount) {
|
||||
if (amount != _fiatAmountController.text) {
|
||||
_fiatAmountController.text = amount;
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => sendViewModel.cryptoAmount, (String amount) {
|
||||
if (amount != _cryptoAmountController.text) {
|
||||
_cryptoAmountController.text = amount;
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => sendViewModel.address, (String address) {
|
||||
if (address != _addressController.text) {
|
||||
_addressController.text = address;
|
||||
}
|
||||
});
|
||||
|
||||
_addressController.addListener(() {
|
||||
final address = _addressController.text;
|
||||
|
||||
if (sendViewModel.address != address) {
|
||||
sendViewModel.changeAddress(address);
|
||||
}
|
||||
});
|
||||
|
||||
_fiatAmountController.addListener(() {
|
||||
final fiatAmount = _fiatAmountController.text;
|
||||
|
||||
if (sendViewModel.fiatAmount != fiatAmount) {
|
||||
sendViewModel.changeFiatAmount(fiatAmount);
|
||||
}
|
||||
});
|
||||
|
||||
_cryptoAmountController.addListener(() {
|
||||
final cryptoAmount = _cryptoAmountController.text;
|
||||
|
||||
if (sendViewModel.cryptoAmount != cryptoAmount) {
|
||||
sendViewModel.changeCryptoAmount(cryptoAmount);
|
||||
}
|
||||
});
|
||||
|
||||
_focusNode.addListener(() {
|
||||
if (!_focusNode.hasFocus && _addressController.text.isNotEmpty) {
|
||||
getOpenaliasRecord(context);
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => sendViewModel.state, (SendViewModelState state) {
|
||||
if (state is SendingFailed) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(S.of(context).error),
|
||||
content: Text(state.error),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text(S.of(context).ok),
|
||||
onPressed: () => Navigator.of(context).pop())
|
||||
],
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (state is TransactionCreatedSuccessfully) {
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// showDialog<void>(
|
||||
// context: context,
|
||||
// builder: (BuildContext context) {
|
||||
// return ConfirmSendingAlert(
|
||||
// alertTitle: S.of(context).confirm_sending,
|
||||
// amount: S.of(context).send_amount,
|
||||
// amountValue: sendStore.pendingTransaction.amount,
|
||||
// fee: S.of(context).send_fee,
|
||||
// feeValue: sendStore.pendingTransaction.fee,
|
||||
// leftButtonText: S.of(context).ok,
|
||||
// rightButtonText: S.of(context).cancel,
|
||||
// actionLeftButton: () {
|
||||
// Navigator.of(context).pop();
|
||||
// sendStore.commitTransaction();
|
||||
// showDialog<void>(
|
||||
// context: context,
|
||||
// builder: (BuildContext context) {
|
||||
// return SendingAlert(sendStore: sendStore);
|
||||
// });
|
||||
// },
|
||||
// actionRightButton: () => Navigator.of(context).pop());
|
||||
// });
|
||||
// });
|
||||
}
|
||||
|
||||
if (state is TransactionCommitted) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_addressController.text = '';
|
||||
_cryptoAmountController.text = '';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
_effectsInstalled = true;
|
||||
}
|
||||
|
||||
Future<void> getOpenaliasRecord(BuildContext context) async {
|
||||
final isOpenalias = await sendViewModel.isOpenaliasRecord(_addressController.text);
|
||||
|
||||
if (isOpenalias) {
|
||||
_addressController.text = sendViewModel.recordAddress;
|
||||
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertWithOneAction(
|
||||
alertTitle: S.of(context).openalias_alert_title,
|
||||
alertContent: S.of(context).openalias_alert_content(sendViewModel.recordName),
|
||||
buttonText: S.of(context).ok,
|
||||
buttonAction: () => Navigator.of(context).pop()
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,7 +8,6 @@ import 'package:cake_wallet/core/address_label_validator.dart';
|
|||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class AddressEditOrCreatePage extends BasePage {
|
||||
AddressEditOrCreatePage({@required this.addressEditOrCreateViewModel})
|
||||
|
@ -29,12 +28,6 @@ class AddressEditOrCreatePage extends BasePage {
|
|||
@override
|
||||
String get title => S.current.new_subaddress_title;
|
||||
|
||||
@override
|
||||
Color get backgroundLightColor => PaletteDark.backgroundColor;
|
||||
|
||||
@override
|
||||
Color get backgroundDarkColor => PaletteDark.backgroundColor;
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) {
|
||||
reaction((_) => addressEditOrCreateViewModel.state,
|
||||
|
@ -55,7 +48,6 @@ class AddressEditOrCreatePage extends BasePage {
|
|||
child: Center(
|
||||
child: BaseTextFormField(
|
||||
controller: _labelController,
|
||||
textColor: Colors.white,
|
||||
hintText: S.of(context).new_subaddress_label_name,
|
||||
validator: AddressLabelValidator()))),
|
||||
Observer(
|
||||
|
|
|
@ -24,7 +24,6 @@ class TradeDetailsPage extends BasePage {
|
|||
formatDefault: "dd.MM.yyyy, HH:mm");
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.only(top: 20, bottom: 20),
|
||||
child: Observer(builder: (_) {
|
||||
final trade = exchangeStore.trade;
|
||||
final items = [
|
||||
|
@ -59,17 +58,15 @@ class TradeDetailsPage extends BasePage {
|
|||
separatorBuilder: (_, __) => Container(
|
||||
height: 1,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
color: Theme.of(context).primaryTextTheme.title.backgroundColor,
|
||||
),
|
||||
),
|
||||
itemCount: items.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final item = items[index];
|
||||
|
||||
final isDrawTop = index == 0 ? true : false;
|
||||
final isDrawBottom = index == items.length - 1 ? true : false;
|
||||
|
||||
return GestureDetector(
|
||||
|
@ -87,7 +84,6 @@ class TradeDetailsPage extends BasePage {
|
|||
child: StandartListRow(
|
||||
title: '${item.title}',
|
||||
value: '${item.value}',
|
||||
isDrawTop: isDrawTop,
|
||||
isDrawBottom: isDrawBottom,
|
||||
));
|
||||
});
|
||||
|
|
|
@ -73,22 +73,19 @@ class TransactionDetailsPage extends BasePage {
|
|||
@override
|
||||
Widget body(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(top: 20, bottom: 20),
|
||||
child: ListView.separated(
|
||||
separatorBuilder: (context, index) => Container(
|
||||
height: 1,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
color: Theme.of(context).primaryTextTheme.title.backgroundColor,
|
||||
),
|
||||
),
|
||||
itemCount: _items.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = _items[index];
|
||||
|
||||
final isDrawTop = index == 0 ? true : false;
|
||||
final isDrawBottom = index == _items.length - 1 ? true : false;
|
||||
|
||||
return GestureDetector(
|
||||
|
@ -106,7 +103,6 @@ class TransactionDetailsPage extends BasePage {
|
|||
child: StandartListRow(
|
||||
title: '${item.title}:',
|
||||
value: item.value,
|
||||
isDrawTop: isDrawTop,
|
||||
isDrawBottom: isDrawBottom),
|
||||
);
|
||||
}),
|
||||
|
|
|
@ -37,11 +37,14 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
final bitcoinIcon =
|
||||
Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
|
||||
final scrollController = ScrollController();
|
||||
final double tileHeight = 60;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final newWalletImage = Image.asset('assets/images/new_wallet.png',
|
||||
height: 12, width: 12, color: Palette.oceanBlue);
|
||||
height: 12,
|
||||
width: 12,
|
||||
color: Theme.of(context).accentTextTheme.headline.decorationColor);
|
||||
final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
|
||||
height: 12,
|
||||
width: 12,
|
||||
|
@ -58,7 +61,7 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
separatorBuilder: (_, index) => Divider(
|
||||
color: Theme.of(context).backgroundColor, height: 16),
|
||||
color: Theme.of(context).backgroundColor, height: 32),
|
||||
itemCount: widget.walletListViewModel.wallets.length,
|
||||
itemBuilder: (__, index) {
|
||||
final wallet = widget.walletListViewModel.wallets[index];
|
||||
|
@ -72,7 +75,7 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
.generateImagesForWalletMenu(wallet.isCurrent);
|
||||
|
||||
return Container(
|
||||
height: 108,
|
||||
height: tileHeight,
|
||||
width: double.infinity,
|
||||
child: CustomScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
|
@ -82,7 +85,7 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
pinned: false,
|
||||
floating: true,
|
||||
delegate: WalletTile(
|
||||
min: screenWidth - 228,
|
||||
min: screenWidth - 170,
|
||||
max: screenWidth,
|
||||
image: _imageFor(type: wallet.type),
|
||||
walletName: wallet.name,
|
||||
|
@ -93,10 +96,11 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
delegate:
|
||||
SliverChildBuilderDelegate((context, index) {
|
||||
final item = items[index];
|
||||
final color = colors[index];
|
||||
final image = images[index];
|
||||
final firstColor = colors[index*2];
|
||||
final secondColor = colors[index*2 + 1];
|
||||
|
||||
final radius = index == 0 ? 12.0 : 0.0;
|
||||
final radius = index == 0 ? 10.0 : 0.0;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
|
@ -109,8 +113,8 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
wallet.isCurrent);
|
||||
},
|
||||
child: Container(
|
||||
height: 108,
|
||||
width: 108,
|
||||
height: tileHeight,
|
||||
width: 80,
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 5, right: 5),
|
||||
|
@ -118,18 +122,27 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(radius),
|
||||
bottomLeft: Radius.circular(radius)),
|
||||
color: color),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
firstColor,
|
||||
secondColor
|
||||
]
|
||||
)
|
||||
),
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
image,
|
||||
SizedBox(height: 5),
|
||||
SizedBox(height: 2),
|
||||
Text(
|
||||
item,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontSize: 7,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white),
|
||||
)
|
||||
],
|
||||
|
@ -151,9 +164,8 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
Navigator.of(context).pushNamed(Routes.newWalletType),
|
||||
image: newWalletImage,
|
||||
text: S.of(context).wallet_list_create_new_wallet,
|
||||
color: Colors.white,
|
||||
textColor: Palette.oceanBlue,
|
||||
borderColor: Palette.oceanBlue,
|
||||
color: Theme.of(context).accentTextTheme.subtitle.decorationColor,
|
||||
textColor: Theme.of(context).accentTextTheme.headline.decorationColor,
|
||||
),
|
||||
SizedBox(height: 10.0),
|
||||
PrimaryImageButton(
|
||||
|
@ -161,7 +173,7 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
.pushNamed(Routes.restoreWalletType),
|
||||
image: restoreWalletImage,
|
||||
text: S.of(context).wallet_list_restore_wallet,
|
||||
color: Theme.of(context).primaryTextTheme.overline.color,
|
||||
color: Theme.of(context).accentTextTheme.caption.color,
|
||||
textColor: Theme.of(context).primaryTextTheme.title.color)
|
||||
])),
|
||||
));
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
|||
import 'package:cake_wallet/src/stores/wallet_list/wallet_list_store.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
|
||||
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class WalletMenu {
|
||||
WalletMenu(this.context, this.walletListViewModel);
|
||||
|
@ -20,18 +21,25 @@ class WalletMenu {
|
|||
S.current.rescan
|
||||
];
|
||||
|
||||
final List<Color> listColors = [
|
||||
Colors.blue,
|
||||
Colors.orange,
|
||||
Colors.red,
|
||||
Colors.green
|
||||
final List<Color> firstColors = [
|
||||
Palette.cornflower,
|
||||
Palette.moderateOrangeYellow,
|
||||
Palette.lightRed,
|
||||
Palette.shineGreen
|
||||
];
|
||||
|
||||
final List<Color> secondColors = [
|
||||
Palette.royalBlue,
|
||||
Palette.moderateOrange,
|
||||
Palette.persianRed,
|
||||
Palette.moderateGreen
|
||||
];
|
||||
|
||||
final List<Image> listImages = [
|
||||
Image.asset('assets/images/load.png', height: 32, width: 32, color: Colors.white),
|
||||
Image.asset('assets/images/eye_action.png', height: 32, width: 32, color: Colors.white),
|
||||
Image.asset('assets/images/trash.png', height: 32, width: 32, color: Colors.white),
|
||||
Image.asset('assets/images/scanner.png', height: 32, width: 32, color: Colors.white)
|
||||
Image.asset('assets/images/load.png', height: 24, width: 24, color: Colors.white),
|
||||
Image.asset('assets/images/eye_action.png', height: 24, width: 24, color: Colors.white),
|
||||
Image.asset('assets/images/trash.png', height: 24, width: 24, color: Colors.white),
|
||||
Image.asset('assets/images/scanner.png', height: 24, width: 24, color: Colors.white)
|
||||
];
|
||||
|
||||
List<String> generateItemsForWalletMenu(bool isCurrentWallet) {
|
||||
|
@ -46,18 +54,30 @@ class WalletMenu {
|
|||
}
|
||||
|
||||
List<Color> generateColorsForWalletMenu(bool isCurrentWallet) {
|
||||
final colors = List<Color>();
|
||||
final colors = <Color>[];
|
||||
|
||||
if (!isCurrentWallet) colors.add(listColors[0]);
|
||||
if (isCurrentWallet) colors.add(listColors[1]);
|
||||
if (!isCurrentWallet) colors.add(listColors[2]);
|
||||
if (isCurrentWallet) colors.add(listColors[3]);
|
||||
if (!isCurrentWallet) {
|
||||
colors.add(firstColors[0]);
|
||||
colors.add(secondColors[0]);
|
||||
}
|
||||
if (isCurrentWallet) {
|
||||
colors.add(firstColors[1]);
|
||||
colors.add(secondColors[1]);
|
||||
}
|
||||
if (!isCurrentWallet) {
|
||||
colors.add(firstColors[2]);
|
||||
colors.add(secondColors[2]);
|
||||
}
|
||||
if (isCurrentWallet) {
|
||||
colors.add(firstColors[3]);
|
||||
colors.add(secondColors[3]);
|
||||
}
|
||||
|
||||
return colors;
|
||||
}
|
||||
|
||||
List<Image> generateImagesForWalletMenu(bool isCurrentWallet) {
|
||||
final images = List<Image>();
|
||||
final images = <Image>[];
|
||||
|
||||
if (!isCurrentWallet) images.add(listImages[0]);
|
||||
if (isCurrentWallet) images.add(listImages[1]);
|
||||
|
|
|
@ -17,17 +17,18 @@ class WalletTile extends SliverPersistentHeaderDelegate {
|
|||
final String walletName;
|
||||
final String walletAddress;
|
||||
final bool isCurrent;
|
||||
final double tileHeight = 60;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
|
||||
var opacity = 1 - shrinkOffset / (max - min);
|
||||
opacity = opacity >= 0 ? opacity : 0;
|
||||
|
||||
var panelWidth = 12 * opacity;
|
||||
panelWidth = panelWidth < 12 ? 0 : 12;
|
||||
var panelWidth = 10 * opacity;
|
||||
panelWidth = panelWidth < 10 ? 0 : 10;
|
||||
|
||||
final currentColor = isCurrent
|
||||
? Theme.of(context).accentTextTheme.caption.color
|
||||
? Theme.of(context).accentTextTheme.subtitle.decorationColor
|
||||
: Theme.of(context).backgroundColor;
|
||||
|
||||
return Stack(
|
||||
|
@ -38,7 +39,7 @@ class WalletTile extends SliverPersistentHeaderDelegate {
|
|||
top: 0,
|
||||
right: max - 4,
|
||||
child: Container(
|
||||
height: 108,
|
||||
height: tileHeight,
|
||||
width: 4,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(topRight: Radius.circular(4), bottomRight: Radius.circular(4)),
|
||||
|
@ -48,13 +49,30 @@ class WalletTile extends SliverPersistentHeaderDelegate {
|
|||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 12,
|
||||
right: 10,
|
||||
child: Container(
|
||||
height: 108,
|
||||
width: max - 16,
|
||||
height: tileHeight,
|
||||
width: max - 14,
|
||||
padding: EdgeInsets.only(left: 20, right: 20),
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: Column(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
//mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
image,
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
walletName,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
/*Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
|
@ -92,7 +110,7 @@ class WalletTile extends SliverPersistentHeaderDelegate {
|
|||
)
|
||||
: Offstage()
|
||||
],
|
||||
),
|
||||
),*/
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
|
@ -101,29 +119,18 @@ class WalletTile extends SliverPersistentHeaderDelegate {
|
|||
child: Opacity(
|
||||
opacity: opacity,
|
||||
child: Container(
|
||||
height: 108,
|
||||
height: tileHeight,
|
||||
width: panelWidth,
|
||||
padding: EdgeInsets.only(
|
||||
top: 1,
|
||||
left: 1,
|
||||
bottom: 1
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), bottomLeft: Radius.circular(12)),
|
||||
color: Theme.of(context).accentTextTheme.subtitle.color
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), bottomLeft: Radius.circular(12)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Theme.of(context).accentTextTheme.caption.backgroundColor,
|
||||
Theme.of(context).accentTextTheme.caption.decorationColor
|
||||
]
|
||||
)
|
||||
),
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Theme.of(context).accentTextTheme.headline.color,
|
||||
Theme.of(context).accentTextTheme.headline.backgroundColor
|
||||
]
|
||||
)
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
@ -1,26 +1,31 @@
|
|||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/domain/common/contact.dart';
|
||||
import 'package:cake_wallet/src/domain/monero/subaddress.dart';
|
||||
import 'package:cake_wallet/src/domain/common/qr_scanner.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
enum AddressTextFieldOption { qrCode, addressBook, subaddressList }
|
||||
enum AddressTextFieldOption { paste, qrCode, addressBook, subaddressList }
|
||||
|
||||
class AddressTextField extends StatelessWidget {
|
||||
AddressTextField(
|
||||
{@required this.controller,
|
||||
this.isActive = true,
|
||||
this.placeholder,
|
||||
this.options = const [
|
||||
AddressTextFieldOption.qrCode,
|
||||
AddressTextFieldOption.addressBook
|
||||
],
|
||||
this.onURIScanned,
|
||||
this.focusNode,
|
||||
this.isBorderExist = true,
|
||||
this.buttonColor,
|
||||
this.validator});
|
||||
this.isActive = true,
|
||||
this.placeholder,
|
||||
this.options = const [
|
||||
AddressTextFieldOption.qrCode,
|
||||
AddressTextFieldOption.addressBook
|
||||
],
|
||||
this.onURIScanned,
|
||||
this.focusNode,
|
||||
this.isBorderExist = true,
|
||||
this.buttonColor,
|
||||
this.borderColor,
|
||||
this.textStyle,
|
||||
this.hintStyle,
|
||||
this.validator});
|
||||
|
||||
static const prefixIconWidth = 34.0;
|
||||
static const prefixIconHeight = 34.0;
|
||||
|
@ -34,6 +39,9 @@ class AddressTextField extends StatelessWidget {
|
|||
final FormFieldValidator<String> validator;
|
||||
final bool isBorderExist;
|
||||
final Color buttonColor;
|
||||
final Color borderColor;
|
||||
final TextStyle textStyle;
|
||||
final TextStyle hintStyle;
|
||||
FocusNode focusNode;
|
||||
|
||||
@override
|
||||
|
@ -45,106 +53,133 @@ class AddressTextField extends StatelessWidget {
|
|||
enabled: isActive,
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
style: TextStyle(
|
||||
style: textStyle ?? TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
color: Colors.white
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: SizedBox(
|
||||
width: prefixIconWidth * options.length +
|
||||
(spaceBetweenPrefixIcons * options.length),
|
||||
),
|
||||
hintStyle: TextStyle(
|
||||
hintStyle: hintStyle ?? TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color
|
||||
color: PaletteDark.darkCyanBlue
|
||||
),
|
||||
hintText: placeholder ?? S.current.widgets_address,
|
||||
focusedBorder: isBorderExist
|
||||
? UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
color: borderColor ?? Theme.of(context).dividerColor,
|
||||
width: 1.0))
|
||||
: InputBorder.none,
|
||||
disabledBorder: isBorderExist
|
||||
? UnderlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: Theme.of(context).dividerColor, width: 1.0))
|
||||
BorderSide(color: borderColor ?? Theme.of(context).dividerColor, width: 1.0))
|
||||
: InputBorder.none,
|
||||
enabledBorder: isBorderExist
|
||||
? UnderlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: Theme.of(context).dividerColor, width: 1.0))
|
||||
BorderSide(color: borderColor ?? Theme.of(context).dividerColor, width: 1.0))
|
||||
: InputBorder.none,
|
||||
),
|
||||
validator: validator,
|
||||
),
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: 0,
|
||||
child: SizedBox(
|
||||
width: prefixIconWidth * options.length +
|
||||
(spaceBetweenPrefixIcons * options.length),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(width: 5),
|
||||
if (this.options.contains(AddressTextFieldOption.qrCode)) ...[
|
||||
Container(
|
||||
width: prefixIconWidth,
|
||||
height: prefixIconHeight,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: InkWell(
|
||||
onTap: () async => _presentQRScanner(context),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: buttonColor ?? Theme.of(context).accentTextTheme.title.color,
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6))),
|
||||
child: Image.asset('assets/images/qr_code_icon.png')),
|
||||
))
|
||||
top: 2,
|
||||
right: 0,
|
||||
child: SizedBox(
|
||||
width: prefixIconWidth * options.length +
|
||||
(spaceBetweenPrefixIcons * options.length),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(width: 5),
|
||||
if (this
|
||||
.options
|
||||
.contains(AddressTextFieldOption.paste)) ...[
|
||||
Container(
|
||||
width: prefixIconWidth,
|
||||
height: prefixIconHeight,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: InkWell(
|
||||
onTap: () async => _pasteAddress(context),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: buttonColor ?? Theme.of(context).accentTextTheme.title.color,
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6))),
|
||||
child: Image.asset(
|
||||
'assets/images/duplicate.png',
|
||||
color: Theme.of(context).primaryTextTheme.display1.decorationColor,
|
||||
)),
|
||||
)),
|
||||
],
|
||||
if (this.options.contains(AddressTextFieldOption.qrCode)) ...[
|
||||
Container(
|
||||
width: prefixIconWidth,
|
||||
height: prefixIconHeight,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: InkWell(
|
||||
onTap: () async => _presentQRScanner(context),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: buttonColor ?? Theme.of(context).accentTextTheme.title.color,
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6))),
|
||||
child: Image.asset('assets/images/qr_code_icon.png',
|
||||
color: Theme.of(context).primaryTextTheme.display1.decorationColor,
|
||||
)),
|
||||
))
|
||||
],
|
||||
if (this
|
||||
.options
|
||||
.contains(AddressTextFieldOption.addressBook)) ...[
|
||||
Container(
|
||||
width: prefixIconWidth,
|
||||
height: prefixIconHeight,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: InkWell(
|
||||
onTap: () async => _presetAddressBookPicker(context),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: buttonColor ?? Theme.of(context).accentTextTheme.title.color,
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6))),
|
||||
child: Image.asset(
|
||||
'assets/images/open_book.png',
|
||||
color: Theme.of(context).primaryTextTheme.display1.decorationColor,
|
||||
)),
|
||||
))
|
||||
],
|
||||
if (this
|
||||
.options
|
||||
.contains(AddressTextFieldOption.subaddressList)) ...[
|
||||
Container(
|
||||
width: prefixIconWidth,
|
||||
height: prefixIconHeight,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: InkWell(
|
||||
onTap: () async => _presetSubaddressListPicker(context),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: buttonColor ?? Theme.of(context).accentTextTheme.title.color,
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6))),
|
||||
child: Image.asset(
|
||||
'assets/images/receive_icon_raw.png',
|
||||
color: Theme.of(context).primaryTextTheme.display1.decorationColor,
|
||||
)),
|
||||
)),
|
||||
],
|
||||
],
|
||||
if (this
|
||||
.options
|
||||
.contains(AddressTextFieldOption.addressBook)) ...[
|
||||
Container(
|
||||
width: prefixIconWidth,
|
||||
height: prefixIconHeight,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: InkWell(
|
||||
onTap: () async => _presetAddressBookPicker(context),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: buttonColor ?? Theme.of(context).accentTextTheme.title.color,
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6))),
|
||||
child: Image.asset(
|
||||
'assets/images/open_book.png')),
|
||||
))
|
||||
],
|
||||
if (this
|
||||
.options
|
||||
.contains(AddressTextFieldOption.subaddressList)) ...[
|
||||
Container(
|
||||
width: prefixIconWidth,
|
||||
height: prefixIconHeight,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: InkWell(
|
||||
onTap: () async => _presetSubaddressListPicker(context),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: buttonColor ?? Theme.of(context).accentTextTheme.title.color,
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6))),
|
||||
child: Image.asset(
|
||||
'assets/images/receive_icon_raw.png')),
|
||||
))
|
||||
],
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
)
|
||||
)
|
||||
],
|
||||
);
|
||||
|
@ -189,4 +224,14 @@ class AddressTextField extends StatelessWidget {
|
|||
controller.text = subaddress.address;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _pasteAddress(BuildContext context) async {
|
||||
String address;
|
||||
|
||||
await Clipboard.getData('text/plain').then((value) => address = value.text);
|
||||
|
||||
if (address.isNotEmpty) {
|
||||
controller.text = address;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class AlertWithOneAction extends BaseAlertDialog {
|
||||
AlertWithOneAction({
|
||||
|
@ -31,13 +32,7 @@ class AlertWithOneAction extends BaseAlertDialog {
|
|||
width: 300,
|
||||
height: 52,
|
||||
padding: EdgeInsets.only(left: 12, right: 12),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(24),
|
||||
bottomRight: Radius.circular(24)
|
||||
),
|
||||
color: Colors.white
|
||||
),
|
||||
color: Palette.blueCraiola,
|
||||
child: ButtonTheme(
|
||||
minWidth: double.infinity,
|
||||
child: FlatButton(
|
||||
|
@ -50,7 +45,7 @@ class AlertWithOneAction extends BaseAlertDialog {
|
|||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.blue,
|
||||
color: Colors.white,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
)),
|
||||
|
|
|
@ -17,6 +17,7 @@ class BaseAlertDialog extends StatelessWidget {
|
|||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
decoration: TextDecoration.none,
|
||||
|
@ -30,7 +31,7 @@ class BaseAlertDialog extends StatelessWidget {
|
|||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontFamily: 'Poppins',
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
|
@ -38,55 +39,39 @@ class BaseAlertDialog extends StatelessWidget {
|
|||
}
|
||||
|
||||
Widget actionButtons(BuildContext context) {
|
||||
return Container(
|
||||
width: 300,
|
||||
height: 52,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(24),
|
||||
bottomRight: Radius.circular(24)
|
||||
),
|
||||
color: Colors.white
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Container(
|
||||
height: 52,
|
||||
padding: EdgeInsets.only(left: 12, right: 12),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24)),
|
||||
),
|
||||
color: Palette.blueCraiola,
|
||||
child: ButtonTheme(
|
||||
minWidth: double.infinity,
|
||||
child: FlatButton(
|
||||
onPressed: actionLeft,
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
child: Text(
|
||||
leftActionButtonText,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.blue,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
)),
|
||||
onPressed: actionLeft,
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
child: Text(
|
||||
leftActionButtonText,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
)),
|
||||
),
|
||||
)
|
||||
),
|
||||
Container(
|
||||
height: 52,
|
||||
width: 1,
|
||||
color: Colors.grey.withOpacity(0.2),
|
||||
),
|
||||
Flexible(
|
||||
),
|
||||
Flexible(
|
||||
child: Container(
|
||||
height: 52,
|
||||
padding: EdgeInsets.only(left: 12, right: 12),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(bottomRight: Radius.circular(24)),
|
||||
),
|
||||
color: Palette.alizarinRed,
|
||||
child: ButtonTheme(
|
||||
minWidth: double.infinity,
|
||||
child: FlatButton(
|
||||
|
@ -98,16 +83,16 @@ class BaseAlertDialog extends StatelessWidget {
|
|||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.red,
|
||||
color: Colors.white,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
)),
|
||||
),
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -126,44 +111,30 @@ class BaseAlertDialog extends StatelessWidget {
|
|||
child: Center(
|
||||
child: GestureDetector(
|
||||
onTap: () => null,
|
||||
child: Container(
|
||||
width: 300,
|
||||
height: 257,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(24)),
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 300,
|
||||
height: 77,
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(24),
|
||||
topRight: Radius.circular(24)
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
child: Container(
|
||||
width: 300,
|
||||
color: Theme.of(context).accentTextTheme.title.decorationColor,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.fromLTRB(24, 32, 24, 32),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
title(context),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 8),
|
||||
child: content(context),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: title(context),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 300,
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
Container(
|
||||
width: 300,
|
||||
height: 127,
|
||||
padding: EdgeInsets.all(24),
|
||||
child: Center(
|
||||
child: content(context),
|
||||
),
|
||||
),
|
||||
actionButtons(context)
|
||||
],
|
||||
actionButtons(context)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -15,11 +15,14 @@ class BaseTextFormField extends StatelessWidget {
|
|||
this.hintColor,
|
||||
this.borderColor,
|
||||
this.prefix,
|
||||
this.prefixIcon,
|
||||
this.suffix,
|
||||
this.suffixIcon,
|
||||
this.enabled = true,
|
||||
this.validator,
|
||||
this.placeholderTextStyle});
|
||||
this.textStyle,
|
||||
this.placeholderTextStyle,
|
||||
this.maxLength});
|
||||
|
||||
final TextEditingController controller;
|
||||
final TextInputType keyboardType;
|
||||
|
@ -33,11 +36,14 @@ class BaseTextFormField extends StatelessWidget {
|
|||
final Color hintColor;
|
||||
final Color borderColor;
|
||||
final Widget prefix;
|
||||
final Widget prefixIcon;
|
||||
final Widget suffix;
|
||||
final Widget suffixIcon;
|
||||
final bool enabled;
|
||||
final FormFieldValidator<String> validator;
|
||||
final TextStyle placeholderTextStyle;
|
||||
final TextStyle textStyle;
|
||||
final int maxLength;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -50,26 +56,31 @@ class BaseTextFormField extends StatelessWidget {
|
|||
maxLines: maxLines,
|
||||
inputFormatters: inputFormatters,
|
||||
enabled: enabled,
|
||||
style: TextStyle(
|
||||
maxLength: maxLength,
|
||||
style: textStyle ?? TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: textColor ?? Theme.of(context).primaryTextTheme.title.color),
|
||||
decoration: InputDecoration(
|
||||
prefix: prefix,
|
||||
prefixIcon: prefixIcon,
|
||||
suffix: suffix,
|
||||
suffixIcon: suffixIcon,
|
||||
hintStyle: placeholderTextStyle ??
|
||||
TextStyle(
|
||||
color: hintColor ??
|
||||
Theme.of(context).primaryTextTheme.caption.color,
|
||||
color: hintColor ?? Theme.of(context).hintColor,
|
||||
fontSize: 16),
|
||||
hintText: hintText,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? Theme.of(context).dividerColor,
|
||||
color: borderColor ?? Theme.of(context).primaryTextTheme.title.backgroundColor,
|
||||
width: 1.0)),
|
||||
disabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? Theme.of(context).primaryTextTheme.title.backgroundColor,
|
||||
width: 1.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? Theme.of(context).dividerColor,
|
||||
color: borderColor ?? Theme.of(context).primaryTextTheme.title.backgroundColor,
|
||||
width: 1.0))),
|
||||
validator: validator,
|
||||
);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class CakeScrollbar extends StatelessWidget {
|
||||
CakeScrollbar({
|
||||
|
@ -20,7 +19,7 @@ class CakeScrollbar extends StatelessWidget {
|
|||
height: backgroundHeight,
|
||||
width: 6,
|
||||
decoration: BoxDecoration(
|
||||
color: PaletteDark.violetBlue,
|
||||
color: Theme.of(context).textTheme.body1.decorationColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(3))
|
||||
),
|
||||
child: Stack(
|
||||
|
@ -32,7 +31,7 @@ class CakeScrollbar extends StatelessWidget {
|
|||
height: thumbHeight,
|
||||
width: 6.0,
|
||||
decoration: BoxDecoration(
|
||||
color: PaletteDark.wildBlueGrey,
|
||||
color: Theme.of(context).textTheme.body1.color,
|
||||
borderRadius: BorderRadius.all(Radius.circular(3))
|
||||
),
|
||||
),
|
||||
|
|
81
lib/src/widgets/checkbox_widget.dart
Normal file
|
@ -0,0 +1,81 @@
|
|||
import 'dart:ui';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CheckboxWidget extends StatefulWidget {
|
||||
CheckboxWidget({
|
||||
@required this.value,
|
||||
@required this.caption,
|
||||
@required this.onChanged});
|
||||
|
||||
final bool value;
|
||||
final String caption;
|
||||
final Function(bool) onChanged;
|
||||
|
||||
@override
|
||||
CheckboxWidgetState createState() => CheckboxWidgetState(value, caption, onChanged);
|
||||
}
|
||||
|
||||
class CheckboxWidgetState extends State<CheckboxWidget> {
|
||||
CheckboxWidgetState(this.value, this.caption, this.onChanged);
|
||||
|
||||
bool value;
|
||||
String caption;
|
||||
Function(bool) onChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
value = !value;
|
||||
onChanged(value);
|
||||
setState(() {});
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 16,
|
||||
width: 16,
|
||||
decoration: BoxDecoration(
|
||||
color: value
|
||||
? Palette.blueCraiola
|
||||
: Theme.of(context).accentTextTheme.subhead.decorationColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(2)),
|
||||
border: Border.all(
|
||||
color: value
|
||||
? Palette.blueCraiola
|
||||
: Theme.of(context).accentTextTheme.overline.color,
|
||||
width: 1
|
||||
)
|
||||
),
|
||||
child: value
|
||||
? Center(
|
||||
child: Icon(
|
||||
Icons.done,
|
||||
color: Colors.white,
|
||||
size: 14,
|
||||
),
|
||||
)
|
||||
: Offstage(),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 16),
|
||||
child: Text(
|
||||
caption,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
fontSize: 18,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w500,
|
||||
decoration: TextDecoration.none
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -71,6 +71,8 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
|
|||
EdgeInsetsDirectional.only(bottom: _paddingBottom, top: paddingTop),
|
||||
child: CupertinoNavigationBar(
|
||||
leading: leading,
|
||||
automaticallyImplyLeading: false,
|
||||
automaticallyImplyMiddle: false,
|
||||
middle: middle,
|
||||
trailing: trailing,
|
||||
backgroundColor: backgroundColor,
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
import 'dart:ui';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_background.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_scrollbar.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class Picker<Item extends Object> extends StatelessWidget {
|
||||
class Picker<Item extends Object> extends StatefulWidget {
|
||||
Picker({
|
||||
@required this.selectedAtIndex,
|
||||
@required this.items,
|
||||
this.images,
|
||||
@required this.title,
|
||||
@required this.onItemSelected,
|
||||
this.mainAxisAlignment = MainAxisAlignment.start
|
||||
this.mainAxisAlignment = MainAxisAlignment.start,
|
||||
this.isAlwaysShowScrollThumb = false
|
||||
});
|
||||
|
||||
final int selectedAtIndex;
|
||||
|
@ -18,59 +23,87 @@ class Picker<Item extends Object> extends StatelessWidget {
|
|||
final String title;
|
||||
final Function(Item) onItemSelected;
|
||||
final MainAxisAlignment mainAxisAlignment;
|
||||
final bool isAlwaysShowScrollThumb;
|
||||
|
||||
@override
|
||||
PickerState createState() => PickerState<Item>(items, images, onItemSelected);
|
||||
}
|
||||
|
||||
class PickerState<Item> extends State<Picker> {
|
||||
PickerState(this.items, this.images, this.onItemSelected);
|
||||
|
||||
final Function(Item) onItemSelected;
|
||||
final List<Item> items;
|
||||
final List<Image> images;
|
||||
|
||||
final closeButton = Image.asset('assets/images/close.png',
|
||||
color: Palette.darkBlueCraiola,
|
||||
);
|
||||
ScrollController controller = ScrollController();
|
||||
|
||||
final double backgroundHeight = 193;
|
||||
final double thumbHeight = 72;
|
||||
double fromTop = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)),
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: TextDecoration.none,
|
||||
color: Colors.white
|
||||
),
|
||||
),
|
||||
controller.addListener(() {
|
||||
fromTop = controller.hasClients
|
||||
? (controller.offset / controller.position.maxScrollExtent * (backgroundHeight - thumbHeight))
|
||||
: 0;
|
||||
setState(() {});
|
||||
});
|
||||
|
||||
return AlertBackground(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
child: Text(
|
||||
widget.title,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: TextDecoration.none,
|
||||
color: Colors.white
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 24, right: 24, top: 24),
|
||||
child: GestureDetector(
|
||||
onTap: () => null,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
child: Container(
|
||||
height: 233,
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
child: ListView.separated(
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 24, right: 24, top: 24),
|
||||
child: GestureDetector(
|
||||
onTap: () => null,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
child: Container(
|
||||
height: 233,
|
||||
color: Theme.of(context).accentTextTheme.title.color,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
ListView.separated(
|
||||
controller: controller,
|
||||
separatorBuilder: (context, index) => Divider(
|
||||
color: Theme.of(context).dividerColor,
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
height: 1,
|
||||
),
|
||||
itemCount: items == null ? 0 : items.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = items[index];
|
||||
final image = images != null? images[index] : null;
|
||||
final isItemSelected = index == selectedAtIndex;
|
||||
final isItemSelected = index == widget.selectedAtIndex;
|
||||
|
||||
final color = isItemSelected
|
||||
? Theme.of(context).accentTextTheme.subtitle.decorationColor
|
||||
: Colors.transparent;
|
||||
? Theme.of(context).textTheme.body2.color
|
||||
: Theme.of(context).accentTextTheme.title.color;
|
||||
final textColor = isItemSelected
|
||||
? Colors.blue
|
||||
? Palette.blueCraiola
|
||||
: Theme.of(context).primaryTextTheme.title.color;
|
||||
|
||||
return GestureDetector(
|
||||
|
@ -87,21 +120,22 @@ class Picker<Item extends Object> extends StatelessWidget {
|
|||
color: color,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: mainAxisAlignment,
|
||||
mainAxisAlignment: widget.mainAxisAlignment,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
image != null
|
||||
? image
|
||||
: Offstage(),
|
||||
? image
|
||||
: Offstage(),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: image != null ? 12 : 0
|
||||
left: image != null ? 12 : 0
|
||||
),
|
||||
child: Text(
|
||||
item.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
color: textColor,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
|
@ -112,17 +146,25 @@ class Picker<Item extends Object> extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
widget.isAlwaysShowScrollThumb
|
||||
? CakeScrollbar(
|
||||
backgroundHeight: backgroundHeight,
|
||||
thumbHeight: thumbHeight,
|
||||
fromTop: fromTop
|
||||
)
|
||||
),
|
||||
),
|
||||
: Offstage(),
|
||||
],
|
||||
)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
AlertCloseButton(image: closeButton)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class PrimaryButton extends StatelessWidget {
|
||||
const PrimaryButton(
|
||||
|
@ -38,7 +37,7 @@ class PrimaryButton extends StatelessWidget {
|
|||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isDisabled
|
||||
? Colors.grey.withOpacity(0.5)
|
||||
? textColor.withOpacity(0.5)
|
||||
: textColor)),
|
||||
));
|
||||
}
|
||||
|
@ -78,7 +77,7 @@ class LoadingPrimaryButton extends StatelessWidget {
|
|||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isDisabled
|
||||
? Colors.grey.withOpacity(0.5)
|
||||
? textColor.withOpacity(0.5)
|
||||
: textColor
|
||||
)),
|
||||
));
|
||||
|
|
|
@ -1,65 +1,82 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StandartListRow extends StatelessWidget {
|
||||
StandartListRow(
|
||||
{this.title,
|
||||
this.value,
|
||||
this.isDrawTop = false,
|
||||
this.titleFontSize = 14,
|
||||
this.valueFontSize = 16,
|
||||
this.image,
|
||||
this.isDrawBottom = false});
|
||||
|
||||
final String title;
|
||||
final String value;
|
||||
final bool isDrawTop;
|
||||
final double titleFontSize;
|
||||
final double valueFontSize;
|
||||
final Image image;
|
||||
final bool isDrawBottom;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
isDrawTop
|
||||
? Container(
|
||||
width: double.infinity,
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
)
|
||||
: Offstage(),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24),
|
||||
const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(title,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: titleFontSize,
|
||||
fontWeight: FontWeight.w500,
|
||||
color:
|
||||
Theme.of(context).primaryTextTheme.caption.color),
|
||||
Theme.of(context).primaryTextTheme.overline.color),
|
||||
textAlign: TextAlign.left),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 12),
|
||||
child: Text(value,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.title
|
||||
.color)),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(value,
|
||||
style: TextStyle(
|
||||
fontSize: valueFontSize,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.title
|
||||
.color)),
|
||||
),
|
||||
image != null
|
||||
? Padding(
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
child: image,
|
||||
)
|
||||
: Offstage()
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
isDrawBottom
|
||||
? Container(
|
||||
width: double.infinity,
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
)
|
||||
: Offstage(),
|
||||
? Container(
|
||||
height: 1,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
color: Theme.of(context).backgroundColor,
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).primaryTextTheme.title.backgroundColor,
|
||||
),
|
||||
)
|
||||
: Offstage(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,77 +1,153 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class TemplateTile extends StatelessWidget {
|
||||
class TemplateTile extends StatefulWidget {
|
||||
TemplateTile({
|
||||
Key key,
|
||||
@required this.to,
|
||||
@required this.amount,
|
||||
@required this.from,
|
||||
@required this.onTap
|
||||
});
|
||||
@required this.onTap,
|
||||
@required this.onRemove
|
||||
}) : super(key: key);
|
||||
|
||||
final String to;
|
||||
final String amount;
|
||||
final String from;
|
||||
final VoidCallback onTap;
|
||||
final VoidCallback onRemove;
|
||||
|
||||
@override
|
||||
TemplateTileState createState() => TemplateTileState(
|
||||
to,
|
||||
amount,
|
||||
from,
|
||||
onTap,
|
||||
onRemove
|
||||
);
|
||||
}
|
||||
|
||||
class TemplateTileState extends State<TemplateTile> {
|
||||
TemplateTileState(
|
||||
this.to,
|
||||
this.amount,
|
||||
this.from,
|
||||
this.onTap,
|
||||
this.onRemove
|
||||
);
|
||||
|
||||
final String to;
|
||||
final String amount;
|
||||
final String from;
|
||||
final VoidCallback onTap;
|
||||
final VoidCallback onRemove;
|
||||
final trash = Image.asset('assets/images/trash.png', height: 16, width: 16, color: Colors.white);
|
||||
|
||||
bool isRemovable = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final toIcon = Image.asset('assets/images/to_icon.png',
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
);
|
||||
final color = isRemovable ? Colors.white : Theme.of(context).primaryTextTheme.title.color;
|
||||
final toIcon = Image.asset('assets/images/to_icon.png', color: color);
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.only(right: 10),
|
||||
child: GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
height: 40,
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
color: Theme.of(context).accentTextTheme.title.backgroundColor
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
amount,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: Text(
|
||||
from,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: toIcon,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: Text(
|
||||
to,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
final content = Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
amount,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: color
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: Text(
|
||||
from,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: color
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: toIcon,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: Text(
|
||||
to,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: color
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
final tile = Container(
|
||||
padding: EdgeInsets.only(right: 10),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
child: GestureDetector(
|
||||
onTap: onTap,
|
||||
onLongPress: () {
|
||||
setState(() {
|
||||
isRemovable = true;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
height: 40,
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
color: Theme.of(context).primaryTextTheme.display3.decorationColor,
|
||||
child: content,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
final removableTile = Container(
|
||||
padding: EdgeInsets.only(right: 10),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isRemovable = false;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
height: 40,
|
||||
padding: EdgeInsets.only(left: 24, right: 10),
|
||||
color: Colors.red,
|
||||
child: content,
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: onRemove,
|
||||
child: Container(
|
||||
height: 40,
|
||||
width: 44,
|
||||
color: Palette.darkRed,
|
||||
child: Center(
|
||||
child: trash,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return isRemovable ? removableTile : tile;
|
||||
}
|
||||
}
|
|
@ -2,25 +2,28 @@ import 'package:flutter/material.dart';
|
|||
|
||||
class TopPanel extends StatefulWidget {
|
||||
TopPanel({
|
||||
@required this.color,
|
||||
@required this.widget,
|
||||
this.edgeInsets = const EdgeInsets.all(24)
|
||||
this.edgeInsets = const EdgeInsets.all(24),
|
||||
this.color,
|
||||
this.gradient
|
||||
});
|
||||
|
||||
final Color color;
|
||||
final Widget widget;
|
||||
final EdgeInsets edgeInsets;
|
||||
final Gradient gradient;
|
||||
|
||||
@override
|
||||
TopPanelState createState() => TopPanelState(color, widget, edgeInsets);
|
||||
TopPanelState createState() => TopPanelState(widget, edgeInsets, color, gradient);
|
||||
}
|
||||
|
||||
class TopPanelState extends State<TopPanel> {
|
||||
TopPanelState(this._color, this._widget, this._edgeInsets);
|
||||
TopPanelState(this._widget, this._edgeInsets, this._color, this._gradient);
|
||||
|
||||
final Color _color;
|
||||
final Widget _widget;
|
||||
final EdgeInsets _edgeInsets;
|
||||
final Gradient _gradient;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -32,7 +35,8 @@ class TopPanelState extends State<TopPanel> {
|
|||
bottomLeft: Radius.circular(24),
|
||||
bottomRight: Radius.circular(24)
|
||||
),
|
||||
color: _color
|
||||
color: _color,
|
||||
gradient: _gradient
|
||||
),
|
||||
child: _widget,
|
||||
);
|
||||
|
|
|
@ -21,7 +21,7 @@ class TrailButton extends StatelessWidget {
|
|||
child: Text(
|
||||
caption,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).primaryTextTheme.caption.color,
|
||||
color: Theme.of(context).textTheme.subhead.decorationColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14),
|
||||
),
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
import 'package:mobx/mobx.dart';
|
||||
|
||||
part 'page_view_store.g.dart';
|
||||
|
||||
class PageViewStore = PageViewStoreBase with _$PageViewStore;
|
||||
|
||||
abstract class PageViewStoreBase with Store {
|
||||
PageViewStoreBase() {
|
||||
setCurrentPage(1);
|
||||
}
|
||||
|
||||
@observable
|
||||
double currentPage;
|
||||
|
||||
@action
|
||||
void setCurrentPage(double currentPage) {
|
||||
this.currentPage = currentPage;
|
||||
}
|
||||
}
|