Merge redesign part 1.

This commit is contained in:
M 2020-09-01 14:18:07 +03:00
commit c950f8bfc0
126 changed files with 4852 additions and 2871 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/images/duplicate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

BIN
assets/images/eye_menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

BIN
assets/images/key_menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

View file

@ -3,10 +3,11 @@ import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/domain/common/wallet_type.dart'; import 'package:cake_wallet/src/domain/common/wallet_type.dart';
class AmountValidator extends TextValidator { class AmountValidator extends TextValidator {
AmountValidator({WalletType type}) AmountValidator({WalletType type, bool isAutovalidate = false})
: super( : super(
errorMessage: S.current.error_text_amount, errorMessage: S.current.error_text_amount,
pattern: _pattern(type), pattern: _pattern(type),
isAutovalidate: isAutovalidate,
minLength: 0, minLength: 0,
maxLength: 0); maxLength: 0);

View 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
);
}

View file

@ -16,18 +16,20 @@ class TextValidator extends Validator<String> {
this.maxLength, this.maxLength,
this.pattern, this.pattern,
this.length, this.length,
this.isAutovalidate = false,
String errorMessage}) String errorMessage})
: super(errorMessage: errorMessage); : super(errorMessage: errorMessage);
final int minLength; final int minLength;
final int maxLength; final int maxLength;
final List<int> length; final List<int> length;
final bool isAutovalidate;
String pattern; String pattern;
@override @override
bool isValid(String value) { bool isValid(String value) {
if (value == null || value.isEmpty) { if (value == null || value.isEmpty) {
return true; return isAutovalidate ? true : false;
} }
return value.length > (minLength ?? 0) && return value.length > (minLength ?? 0) &&
@ -42,4 +44,4 @@ class TextValidator extends Validator<String> {
class WalletNameValidator extends TextValidator { class WalletNameValidator extends TextValidator {
WalletNameValidator() WalletNameValidator()
: super(minLength: 1, maxLength: 15, pattern: '^[a-zA-Z0-9_]\$'); : super(minLength: 1, maxLength: 15, pattern: '^[a-zA-Z0-9_]\$');
} }

View file

@ -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/domain/exchange/trade.dart';
import 'package:cake_wallet/src/screens/contact/contact_list_page.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/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/node_create_or_edit_page.dart';
import 'package:cake_wallet/src/screens/nodes/nodes_list_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/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/settings/settings.dart';
import 'package:cake_wallet/src/screens/wallet_keys/wallet_keys_page.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/contact_list_store.dart';
import 'package:cake_wallet/store/node_list_store.dart'; import 'package:cake_wallet/store/node_list_store.dart';
import 'package:cake_wallet/store/settings_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/send/send_page.dart';
import 'package:cake_wallet/src/screens/subaddress/address_edit_or_create_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/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/store/wallet_list_store.dart';
import 'package:cake_wallet/utils/mobx.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_list_view_model.dart';
import 'package:cake_wallet/view_model/contact_list/contact_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_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/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'; 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_keys_view_model.dart';
import 'package:cake_wallet/view_model/wallet_list/wallet_list_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/wallet_seed_view_model.dart';
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'package:hive/hive.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/trade_filter_store.dart';
import 'package:cake_wallet/store/dashboard/transaction_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/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; final getIt = GetIt.instance;
@ -97,7 +109,9 @@ Future setup(
{Box<WalletInfo> walletInfoSource, {Box<WalletInfo> walletInfoSource,
Box<Node> nodeSource, Box<Node> nodeSource,
Box<Contact> contactSource, Box<Contact> contactSource,
Box<Trade> tradesSource}) async { Box<Trade> tradesSource,
Box<Template> templates,
Box<ExchangeTemplate> exchangeTemplates}) async {
getIt.registerSingletonAsync<SharedPreferences>( getIt.registerSingletonAsync<SharedPreferences>(
() => SharedPreferences.getInstance()); () => SharedPreferences.getInstance());
@ -119,11 +133,13 @@ Future setup(
ContactService(contactSource, getIt.get<AppStore>().contactListStore)); ContactService(contactSource, getIt.get<AppStore>().contactListStore));
getIt.registerSingleton<TradesStore>(TradesStore( getIt.registerSingleton<TradesStore>(TradesStore(
tradesSource: tradesSource, settingsStore: getIt.get<SettingsStore>())); tradesSource: tradesSource, settingsStore: getIt.get<SettingsStore>()));
getIt.registerSingleton<TradeFilterStore>( getIt.registerSingleton<TradeFilterStore>(TradeFilterStore());
TradeFilterStore(wallet: getIt.get<AppStore>().wallet));
getIt.registerSingleton<TransactionFilterStore>(TransactionFilterStore()); getIt.registerSingleton<TransactionFilterStore>(TransactionFilterStore());
getIt.registerSingleton<FiatConvertationStore>(FiatConvertationStore()); getIt.registerSingleton<FiatConvertationStore>(FiatConvertationStore());
getIt.registerSingleton<PageViewStore>(PageViewStore()); getIt.registerSingleton<SendTemplateStore>(
SendTemplateStore(templateSource: templates));
getIt.registerSingleton<ExchangeTemplateStore>(
ExchangeTemplateStore(templateSource: exchangeTemplates));
getIt.registerFactory<KeyService>( getIt.registerFactory<KeyService>(
() => KeyService(getIt.get<FlutterSecureStorage>())); () => KeyService(getIt.get<FlutterSecureStorage>()));
@ -165,8 +181,7 @@ Future setup(
appStore: getIt.get<AppStore>(), appStore: getIt.get<AppStore>(),
tradesStore: getIt.get<TradesStore>(), tradesStore: getIt.get<TradesStore>(),
tradeFilterStore: getIt.get<TradeFilterStore>(), tradeFilterStore: getIt.get<TradeFilterStore>(),
transactionFilterStore: getIt.get<TransactionFilterStore>(), transactionFilterStore: getIt.get<TransactionFilterStore>()));
pageViewStore: getIt.get<PageViewStore>()));
getIt.registerFactory<AuthService>(() => AuthService( getIt.registerFactory<AuthService>(() => AuthService(
secureStorage: getIt.get<FlutterSecureStorage>(), secureStorage: getIt.get<FlutterSecureStorage>(),
@ -210,6 +225,7 @@ Future setup(
addressEditOrCreateViewModel: addressEditOrCreateViewModel:
getIt.get<WalletAddressEditOrCreateViewModel>(param1: item))); getIt.get<WalletAddressEditOrCreateViewModel>(param1: item)));
// getIt.get<SendTemplateStore>()
getIt.registerFactory<SendViewModel>(() => SendViewModel( getIt.registerFactory<SendViewModel>(() => SendViewModel(
getIt.get<AppStore>().wallet, getIt.get<AppStore>().wallet,
getIt.get<AppStore>().settingsStore, getIt.get<AppStore>().settingsStore,
@ -218,6 +234,9 @@ Future setup(
getIt.registerFactory( getIt.registerFactory(
() => SendPage(sendViewModel: getIt.get<SendViewModel>())); () => SendPage(sendViewModel: getIt.get<SendViewModel>()));
// getIt.registerFactory(
// () => SendTemplatePage(sendViewModel: getIt.get<SendViewModel>()));
getIt.registerFactory(() => WalletListViewModel( getIt.registerFactory(() => WalletListViewModel(
walletInfoSource, getIt.get<AppStore>(), getIt.get<KeyService>())); walletInfoSource, getIt.get<AppStore>(), getIt.get<KeyService>()));
@ -300,4 +319,31 @@ Future setup(
getIt.registerFactory( getIt.registerFactory(
() => NodeCreateOrEditPage(getIt.get<NodeCreateOrEditViewModel>())); () => 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));
} }

View file

@ -56,6 +56,8 @@ class S implements WidgetsLocalizations {
String get choose_wallet_currency => "Please choose wallet currency:"; String get choose_wallet_currency => "Please choose wallet currency:";
String get clear => "Clear"; String get clear => "Clear";
String get confirm => "Confirm"; String get confirm => "Confirm";
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 confirm_sending => "Confirm sending";
String get contact => "Contact"; String get contact => "Contact";
String get contact_name => "Contact Name"; String get contact_name => "Contact Name";
@ -94,7 +96,7 @@ class S implements WidgetsLocalizations {
String get expired => "Expired"; String get expired => "Expired";
String get faq => "FAQ"; String get faq => "FAQ";
String get fetching => "Fetching"; String get fetching => "Fetching";
String get filters => "Filters"; String get filters => "Filter";
String get first_wallet_text => "Awesome wallet for Monero"; String get first_wallet_text => "Awesome wallet for Monero";
String get full_balance => "Full Balance"; String get full_balance => "Full Balance";
String get hidden_balance => "Hidden Balance"; String get hidden_balance => "Hidden Balance";
@ -133,6 +135,7 @@ class S implements WidgetsLocalizations {
String get reconnect => "Reconnect"; String get reconnect => "Reconnect";
String get reconnect_alert_text => "Are you sure to reconnect?"; String get reconnect_alert_text => "Are you sure to reconnect?";
String get reconnection => "Reconnection"; String get reconnection => "Reconnection";
String get refund_address => "Refund address";
String get remove => "Remove"; String get remove => "Remove";
String get remove_node => "Remove node"; String get remove_node => "Remove node";
String get remove_node_message => "Are you sure that you want to remove selected node?"; String get remove_node_message => "Are you sure that you want to remove selected node?";
@ -184,14 +187,13 @@ class S implements WidgetsLocalizations {
String get send_estimated_fee => "Estimated fee:"; String get send_estimated_fee => "Estimated fee:";
String get send_fee => "Fee:"; String get send_fee => "Fee:";
String get send_got_it => "Got it"; String get send_got_it => "Got it";
String get send_monero_address => "Monero address";
String get send_name => "Name"; String get send_name => "Name";
String get send_new => "New"; String get send_new => "New";
String get send_payment_id => "Payment ID (optional)"; String get send_payment_id => "Payment ID (optional)";
String get send_sending => "Sending..."; String get send_sending => "Sending...";
String get send_success => "Your Monero was successfully sent"; String get send_success => "Your Monero was successfully sent";
String get send_templates => "Templates"; 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_xmr => "Send XMR";
String get send_your_wallet => "Your wallet"; String get send_your_wallet => "Your wallet";
String get sending => "Sending"; String get sending => "Sending";
@ -235,6 +237,7 @@ class S implements WidgetsLocalizations {
String get sync_status_starting_sync => "STARTING SYNC"; String get sync_status_starting_sync => "STARTING SYNC";
String get sync_status_syncronized => "SYNCHRONIZED"; String get sync_status_syncronized => "SYNCHRONIZED";
String get sync_status_syncronizing => "SYNCHRONIZING"; String get sync_status_syncronizing => "SYNCHRONIZING";
String get template => "Template";
String get today => "Today"; String get today => "Today";
String get trade_details_created_at => "Created at"; String get trade_details_created_at => "Created at";
String get trade_details_fetching => "Fetching"; 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_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_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 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_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.\n\n"; 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 failed_authentication(String state_error) => "Failed authentication. ${state_error}";
String max_value(String value, String currency) => "Max: ${value} ${currency}"; String max_value(String value, String currency) => "Max: ${value} ${currency}";
String min_value(String value, String currency) => "Min: ${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 openalias_alert_content(String recipient_name) => "You will be sending funds to\n${recipient_name}";
String powered_by(String title) => "Powered by ${title}"; String powered_by(String title) => "Powered by ${title}";
String router_no_route(String name) => "No route defined for ${name}"; 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 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 time(String minutes, String seconds) => "${minutes}m ${seconds}s";
String trade_details_copied(String title) => "${title} copied to Clipboard"; String trade_details_copied(String title) => "${title} copied to Clipboard";
@ -370,6 +374,8 @@ class $de extends S {
@override @override
String get trade_state_underpaid => "Unterbezahlt"; String get trade_state_underpaid => "Unterbezahlt";
@override @override
String get refund_address => "Rückerstattungsadresse";
@override
String get welcome => "Willkommen zu"; String get welcome => "Willkommen zu";
@override @override
String get share_address => "Adresse teilen "; String get share_address => "Adresse teilen ";
@ -680,6 +686,8 @@ class $de extends S {
@override @override
String get sync_status_syncronized => "SYNCHRONISIERT"; String get sync_status_syncronized => "SYNCHRONISIERT";
@override @override
String get template => "Vorlage";
@override
String get transaction_priority_medium => "Mittel"; String get transaction_priority_medium => "Mittel";
@override @override
String get transaction_details_transaction_id => "Transaktions-ID"; String get transaction_details_transaction_id => "Transaktions-ID";
@ -728,6 +736,8 @@ class $de extends S {
@override @override
String get trade_not_created => "Handel nicht angelegt."; String get trade_not_created => "Handel nicht angelegt.";
@override @override
String get confirm_delete_wallet => "Diese Aktion löscht diese Brieftasche. Möchten Sie fortfahren?";
@override
String get restore_wallet_name => "Walletname"; String get restore_wallet_name => "Walletname";
@override @override
String get widgets_seed => "Seed"; String get widgets_seed => "Seed";
@ -736,6 +746,8 @@ class $de extends S {
@override @override
String get rename => "Umbenennen"; String get rename => "Umbenennen";
@override @override
String get confirm_delete_template => "Diese Aktion löscht diese Vorlage. Möchten Sie fortfahren?";
@override
String get restore_active_seed => "Aktives Seed"; String get restore_active_seed => "Aktives Seed";
@override @override
String get send_name => "Name"; String get send_name => "Name";
@ -798,7 +810,7 @@ class $de extends S {
@override @override
String get send => "Senden"; String get send => "Senden";
@override @override
String get send_title => "Senden Sie Monero"; String get send_title => "Senden Sie";
@override @override
String get error_text_keys => "Walletschlüssel können nur 64 hexadezimale Zeichen enthalten"; String get error_text_keys => "Walletschlüssel können nur 64 hexadezimale Zeichen enthalten";
@override @override
@ -882,8 +894,6 @@ class $de extends S {
@override @override
String get restore_description_from_backup => "Sie können die gesamte Cake Wallet-App von wiederherstellen Ihre Sicherungsdatei"; String get restore_description_from_backup => "Sie können die gesamte Cake Wallet-App von wiederherstellen Ihre Sicherungsdatei";
@override @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"; String get error_text_node_port => "Der Knotenport kann nur Nummern zwischen 0 und 65535 enthalten";
@override @override
String get add_new_word => "Neues Wort hinzufügen"; String get add_new_word => "Neues Wort hinzufügen";
@ -930,17 +940,19 @@ class $de extends S {
@override @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}"; 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 @override
String send_address(String cryptoCurrency) => "${cryptoCurrency}-Adresse";
@override
String min_value(String value, String currency) => "Mindest: ${value} ${currency}"; String min_value(String value, String currency) => "Mindest: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "Authentifizierung fehlgeschlagen. ${state_error}"; String failed_authentication(String state_error) => "Authentifizierung fehlgeschlagen. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} Verbleibende Blöcke"; String Blocks_remaining(String status) => "${status} Verbleibende Blöcke";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "Handel für ${provider} wird nicht erstellt. Das Laden der Limits ist fehlgeschlagen"; String error_text_limits_loading_failed(String provider) => "Handel für ${provider} wird nicht erstellt. Das Laden der Limits ist fehlgeschlagen";
@override @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 @override
String commit_transaction_amount_fee(String amount, String fee) => "Transaktion festschreiben\nMenge: ${amount}\nGebühr: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "Transaktion festschreiben\nMenge: ${amount}\nGebühr: ${fee}";
@override @override
@ -994,6 +1006,8 @@ class $hi extends S {
@override @override
String get trade_state_underpaid => "के तहत भुगतान किया"; String get trade_state_underpaid => "के तहत भुगतान किया";
@override @override
String get refund_address => "वापसी का पता";
@override
String get welcome => "स्वागत हे सेवा मेरे"; String get welcome => "स्वागत हे सेवा मेरे";
@override @override
String get share_address => "पता साझा करें"; String get share_address => "पता साझा करें";
@ -1202,7 +1216,7 @@ class $hi extends S {
@override @override
String get estimated => "अनुमानित"; String get estimated => "अनुमानित";
@override @override
String get filters => "िल्टर"; String get filters => "िल्टर";
@override @override
String get settings_current_node => "वर्तमान नोड"; String get settings_current_node => "वर्तमान नोड";
@override @override
@ -1304,6 +1318,8 @@ class $hi extends S {
@override @override
String get sync_status_syncronized => "सिंक्रनाइज़"; String get sync_status_syncronized => "सिंक्रनाइज़";
@override @override
String get template => "खाका";
@override
String get transaction_priority_medium => "मध्यम"; String get transaction_priority_medium => "मध्यम";
@override @override
String get transaction_details_transaction_id => "लेनदेन आईडी"; String get transaction_details_transaction_id => "लेनदेन आईडी";
@ -1352,6 +1368,8 @@ class $hi extends S {
@override @override
String get trade_not_created => "व्यापार नहीं बनाया गया."; String get trade_not_created => "व्यापार नहीं बनाया गया.";
@override @override
String get confirm_delete_wallet => "यह क्रिया इस वॉलेट को हटा देगी। क्या आप जारी रखना चाहते हैं?";
@override
String get restore_wallet_name => "बटुए का नाम"; String get restore_wallet_name => "बटुए का नाम";
@override @override
String get widgets_seed => "बीज"; String get widgets_seed => "बीज";
@ -1360,6 +1378,8 @@ class $hi extends S {
@override @override
String get rename => "नाम बदलें"; String get rename => "नाम बदलें";
@override @override
String get confirm_delete_template => "यह क्रिया इस टेम्पलेट को हटा देगी। क्या आप जारी रखना चाहते हैं?";
@override
String get restore_active_seed => "सक्रिय बीज"; String get restore_active_seed => "सक्रिय बीज";
@override @override
String get send_name => "नाम"; String get send_name => "नाम";
@ -1422,7 +1442,7 @@ class $hi extends S {
@override @override
String get send => "संदेश"; String get send => "संदेश";
@override @override
String get send_title => "संदेश Monero"; String get send_title => "संदेश";
@override @override
String get error_text_keys => "वॉलेट कीज़ में हेक्स में केवल 64 वर्ण हो सकते हैं"; String get error_text_keys => "वॉलेट कीज़ में हेक्स में केवल 64 वर्ण हो सकते हैं";
@override @override
@ -1506,8 +1526,6 @@ class $hi extends S {
@override @override
String get restore_description_from_backup => "आप से पूरे केक वॉलेट एप्लिकेशन को पुनर्स्थापित कर सकते हैं आपकी बैक-अप फ़ाइल"; String get restore_description_from_backup => "आप से पूरे केक वॉलेट एप्लिकेशन को पुनर्स्थापित कर सकते हैं आपकी बैक-अप फ़ाइल";
@override @override
String get send_monero_address => "मोनरो पता";
@override
String get error_text_node_port => "नोड पोर्ट में केवल 0 और 65535 के बीच संख्याएँ हो सकती हैं"; String get error_text_node_port => "नोड पोर्ट में केवल 0 और 65535 के बीच संख्याएँ हो सकती हैं";
@override @override
String get add_new_word => "नया शब्द जोड़ें"; String get add_new_word => "नया शब्द जोड़ें";
@ -1554,17 +1572,19 @@ class $hi extends S {
@override @override
String error_text_maximum_limit(String provider, String max, String currency) => "व्यापार ${provider} के लिए नहीं बनाया गया है। राशि अधिक है तो अधिकतम: ${max} ${currency}"; String error_text_maximum_limit(String provider, String max, String currency) => "व्यापार ${provider} के लिए नहीं बनाया गया है। राशि अधिक है तो अधिकतम: ${max} ${currency}";
@override @override
String send_address(String cryptoCurrency) => "${cryptoCurrency} पता";
@override
String min_value(String value, String currency) => "मिन: ${value} ${currency}"; String min_value(String value, String currency) => "मिन: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "प्रमाणीकरण विफल. ${state_error}"; String failed_authentication(String state_error) => "प्रमाणीकरण विफल. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} शेष रहते हैं"; String Blocks_remaining(String status) => "${status} शेष रहते हैं";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "व्यापार ${provider} के लिए नहीं बनाया गया है। लोडिंग की सीमाएं विफल रहीं"; String error_text_limits_loading_failed(String provider) => "व्यापार ${provider} के लिए नहीं बनाया गया है। लोडिंग की सीमाएं विफल रहीं";
@override @override
String exchange_result_description(String fetchingLabel, String from) => "कृपया भेजें ${fetchingLabel} ${from} ऊपर दिखाए गए पते पर\n\n'"; String exchange_result_description(String fetchingLabel, String from) => "कृपया भेजें ${fetchingLabel} ${from} ऊपर दिखाए गए पते पर";
@override @override
String commit_transaction_amount_fee(String amount, String fee) => "लेन-देन करें\nरकम: ${amount}\nशुल्क: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "लेन-देन करें\nरकम: ${amount}\nशुल्क: ${fee}";
@override @override
@ -1618,6 +1638,8 @@ class $ru extends S {
@override @override
String get trade_state_underpaid => "Недоплаченная"; String get trade_state_underpaid => "Недоплаченная";
@override @override
String get refund_address => "Адрес возврата";
@override
String get welcome => "Приветствуем в"; String get welcome => "Приветствуем в";
@override @override
String get share_address => "Поделиться адресом"; String get share_address => "Поделиться адресом";
@ -1826,7 +1848,7 @@ class $ru extends S {
@override @override
String get estimated => "Примерно"; String get estimated => "Примерно";
@override @override
String get filters => "Фильтры"; String get filters => "Фильтр";
@override @override
String get settings_current_node => "Текущая нода"; String get settings_current_node => "Текущая нода";
@override @override
@ -1928,6 +1950,8 @@ class $ru extends S {
@override @override
String get sync_status_syncronized => "СИНХРОНИЗИРОВАН"; String get sync_status_syncronized => "СИНХРОНИЗИРОВАН";
@override @override
String get template => "Шаблон";
@override
String get transaction_priority_medium => "Средний"; String get transaction_priority_medium => "Средний";
@override @override
String get transaction_details_transaction_id => "ID транзакции"; String get transaction_details_transaction_id => "ID транзакции";
@ -1976,6 +2000,8 @@ class $ru extends S {
@override @override
String get trade_not_created => "Сделка не создана."; String get trade_not_created => "Сделка не создана.";
@override @override
String get confirm_delete_wallet => "Это действие удалит кошелек. Вы хотите продолжить?";
@override
String get restore_wallet_name => "Имя кошелька"; String get restore_wallet_name => "Имя кошелька";
@override @override
String get widgets_seed => "Мнемоническая фраза"; String get widgets_seed => "Мнемоническая фраза";
@ -1984,6 +2010,8 @@ class $ru extends S {
@override @override
String get rename => "Переименовать"; String get rename => "Переименовать";
@override @override
String get confirm_delete_template => "Это действие удалит шаблон. Вы хотите продолжить?";
@override
String get restore_active_seed => "Активная мнемоническая фраза"; String get restore_active_seed => "Активная мнемоническая фраза";
@override @override
String get send_name => "Имя"; String get send_name => "Имя";
@ -2046,7 +2074,7 @@ class $ru extends S {
@override @override
String get send => "Отправить"; String get send => "Отправить";
@override @override
String get send_title => "Отправить Monero"; String get send_title => "Отправить";
@override @override
String get error_text_keys => "Ключи кошелька могут содержать только 64 символа в hex"; String get error_text_keys => "Ключи кошелька могут содержать только 64 символа в hex";
@override @override
@ -2130,8 +2158,6 @@ class $ru extends S {
@override @override
String get restore_description_from_backup => "Вы можете восстановить Cake Wallet из вашего back-up файла"; String get restore_description_from_backup => "Вы можете восстановить Cake Wallet из вашего back-up файла";
@override @override
String get send_monero_address => "Monero адрес";
@override
String get error_text_node_port => "Порт ноды может содержать только цифры от 0 до 65535"; String get error_text_node_port => "Порт ноды может содержать только цифры от 0 до 65535";
@override @override
String get add_new_word => "Добавить новое слово"; String get add_new_word => "Добавить новое слово";
@ -2178,17 +2204,19 @@ class $ru extends S {
@override @override
String error_text_maximum_limit(String provider, String max, String currency) => "Сделка для ${provider} не создана. Сумма больше максимальной: ${max} ${currency}"; String error_text_maximum_limit(String provider, String max, String currency) => "Сделка для ${provider} не создана. Сумма больше максимальной: ${max} ${currency}";
@override @override
String send_address(String cryptoCurrency) => "${cryptoCurrency} адрес";
@override
String min_value(String value, String currency) => "Мин: ${value} ${currency}"; String min_value(String value, String currency) => "Мин: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "Ошибка аутентификации. ${state_error}"; String failed_authentication(String state_error) => "Ошибка аутентификации. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} Осталось блоков"; String Blocks_remaining(String status) => "${status} Осталось блоков";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "Сделка для ${provider} не создана. Ошибка загрузки лимитов"; String error_text_limits_loading_failed(String provider) => "Сделка для ${provider} не создана. Ошибка загрузки лимитов";
@override @override
String exchange_result_description(String fetchingLabel, String from) => "Пожалуйста отправьте ${fetchingLabel} ${from} на адрес, указанный выше.\n\n'"; String exchange_result_description(String fetchingLabel, String from) => "Пожалуйста отправьте ${fetchingLabel} ${from} на адрес, указанный выше.";
@override @override
String commit_transaction_amount_fee(String amount, String fee) => "Подтвердить транзакцию \nСумма: ${amount}\nКомиссия: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "Подтвердить транзакцию \nСумма: ${amount}\nКомиссия: ${fee}";
@override @override
@ -2242,6 +2270,8 @@ class $ko extends S {
@override @override
String get trade_state_underpaid => "미지급"; String get trade_state_underpaid => "미지급";
@override @override
String get refund_address => "환불 주소";
@override
String get welcome => "환영 에"; String get welcome => "환영 에";
@override @override
String get share_address => "주소 공유"; String get share_address => "주소 공유";
@ -2552,6 +2582,8 @@ class $ko extends S {
@override @override
String get sync_status_syncronized => "동기화"; String get sync_status_syncronized => "동기화";
@override @override
String get template => "주형";
@override
String get transaction_priority_medium => "매질"; String get transaction_priority_medium => "매질";
@override @override
String get transaction_details_transaction_id => "트랜잭션 ID"; String get transaction_details_transaction_id => "트랜잭션 ID";
@ -2600,6 +2632,8 @@ class $ko extends S {
@override @override
String get trade_not_created => "거래가 생성되지 않았습니다."; String get trade_not_created => "거래가 생성되지 않았습니다.";
@override @override
String get confirm_delete_wallet => "이 작업은이 지갑을 삭제합니다. 계속 하시겠습니까?";
@override
String get restore_wallet_name => "지갑 이름"; String get restore_wallet_name => "지갑 이름";
@override @override
String get widgets_seed => ""; String get widgets_seed => "";
@ -2608,6 +2642,8 @@ class $ko extends S {
@override @override
String get rename => "이름 바꾸기"; String get rename => "이름 바꾸기";
@override @override
String get confirm_delete_template => "이 작업은이 템플릿을 삭제합니다. 계속 하시겠습니까?";
@override
String get restore_active_seed => "활성 종자"; String get restore_active_seed => "활성 종자";
@override @override
String get send_name => "이름"; String get send_name => "이름";
@ -2670,7 +2706,7 @@ class $ko extends S {
@override @override
String get send => "보내다"; String get send => "보내다";
@override @override
String get send_title => "모네로 보내기"; String get send_title => "보내다";
@override @override
String get error_text_keys => "지갑 키는 16 진수로 64 자만 포함 할 수 있습니다"; String get error_text_keys => "지갑 키는 16 진수로 64 자만 포함 할 수 있습니다";
@override @override
@ -2754,8 +2790,6 @@ class $ko extends S {
@override @override
String get restore_description_from_backup => "백업 파일에서 전체 Cake Wallet 앱을 복원 할 수 있습니다."; String get restore_description_from_backup => "백업 파일에서 전체 Cake Wallet 앱을 복원 할 수 있습니다.";
@override @override
String get send_monero_address => "모네로 주소";
@override
String get error_text_node_port => "노드 포트는 0에서 65535 사이의 숫자 만 포함 할 수 있습니다"; String get error_text_node_port => "노드 포트는 0에서 65535 사이의 숫자 만 포함 할 수 있습니다";
@override @override
String get add_new_word => "새로운 단어 추가"; String get add_new_word => "새로운 단어 추가";
@ -2802,17 +2836,19 @@ class $ko extends S {
@override @override
String error_text_maximum_limit(String provider, String max, String currency) => "거래 ${provider} 가 생성되지 않습니다. 금액이 최대 값보다 많습니다. ${max} ${currency}"; String error_text_maximum_limit(String provider, String max, String currency) => "거래 ${provider} 가 생성되지 않습니다. 금액이 최대 값보다 많습니다. ${max} ${currency}";
@override @override
String send_address(String cryptoCurrency) => "${cryptoCurrency} 주소";
@override
String min_value(String value, String currency) => "최소: ${value} ${currency}"; String min_value(String value, String currency) => "최소: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "인증 실패. ${state_error}"; String failed_authentication(String state_error) => "인증 실패. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} 남은 블록"; String Blocks_remaining(String status) => "${status} 남은 블록";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "거래 ${provider} 가 생성되지 않습니다. 로딩 실패"; String error_text_limits_loading_failed(String provider) => "거래 ${provider} 가 생성되지 않습니다. 로딩 실패";
@override @override
String exchange_result_description(String fetchingLabel, String from) => "보내주세요 ${fetchingLabel} ${from} 위에 표시된 주소로.\n\n'"; String exchange_result_description(String fetchingLabel, String from) => "보내주세요 ${fetchingLabel} ${from} 위에 표시된 주소로.";
@override @override
String commit_transaction_amount_fee(String amount, String fee) => "커밋 거래\n양: ${amount}\n보수: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "커밋 거래\n양: ${amount}\n보수: ${fee}";
@override @override
@ -2866,6 +2902,8 @@ class $pt extends S {
@override @override
String get trade_state_underpaid => "Parcialmente paga"; String get trade_state_underpaid => "Parcialmente paga";
@override @override
String get refund_address => "Endereço de reembolso";
@override
String get welcome => "Bem-vindo ao"; String get welcome => "Bem-vindo ao";
@override @override
String get share_address => "Compartilhar endereço"; String get share_address => "Compartilhar endereço";
@ -3074,7 +3112,7 @@ class $pt extends S {
@override @override
String get estimated => "Estimado"; String get estimated => "Estimado";
@override @override
String get filters => "Filtros"; String get filters => "Filtro";
@override @override
String get settings_current_node => "Nó atual"; String get settings_current_node => "Nó atual";
@override @override
@ -3176,6 +3214,8 @@ class $pt extends S {
@override @override
String get sync_status_syncronized => "SINCRONIZADO"; String get sync_status_syncronized => "SINCRONIZADO";
@override @override
String get template => "Modelo";
@override
String get transaction_priority_medium => "Média"; String get transaction_priority_medium => "Média";
@override @override
String get transaction_details_transaction_id => "ID da transação"; String get transaction_details_transaction_id => "ID da transação";
@ -3224,6 +3264,8 @@ class $pt extends S {
@override @override
String get trade_not_created => "Troca não criada."; String get trade_not_created => "Troca não criada.";
@override @override
String get confirm_delete_wallet => "Esta ação excluirá esta carteira. Você deseja continuar?";
@override
String get restore_wallet_name => "Nome da carteira"; String get restore_wallet_name => "Nome da carteira";
@override @override
String get widgets_seed => "Semente"; String get widgets_seed => "Semente";
@ -3232,6 +3274,8 @@ class $pt extends S {
@override @override
String get rename => "Renomear"; String get rename => "Renomear";
@override @override
String get confirm_delete_template => "Esta ação excluirá este modelo. Você deseja continuar?";
@override
String get restore_active_seed => "Semente ativa"; String get restore_active_seed => "Semente ativa";
@override @override
String get send_name => "Nome"; String get send_name => "Nome";
@ -3294,7 +3338,7 @@ class $pt extends S {
@override @override
String get send => "Enviar"; String get send => "Enviar";
@override @override
String get send_title => "Enviar Monero"; String get send_title => "Enviar";
@override @override
String get error_text_keys => "As chaves da carteira podem conter apenas 64 caracteres em hexadecimal"; String get error_text_keys => "As chaves da carteira podem conter apenas 64 caracteres em hexadecimal";
@override @override
@ -3378,8 +3422,6 @@ class $pt extends S {
@override @override
String get restore_description_from_backup => "Você pode restaurar todo o aplicativo Cake Wallet de seu arquivo de backup"; String get restore_description_from_backup => "Você pode restaurar todo o aplicativo Cake Wallet de seu arquivo de backup";
@override @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"; String get error_text_node_port => "A porta do nó deve conter apenas números entre 0 e 65535";
@override @override
String get add_new_word => "Adicionar nova palavra"; String get add_new_word => "Adicionar nova palavra";
@ -3426,17 +3468,19 @@ class $pt extends S {
@override @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}"; 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 @override
String send_address(String cryptoCurrency) => "Endereço ${cryptoCurrency}";
@override
String min_value(String value, String currency) => "Mín: ${value} ${currency}"; String min_value(String value, String currency) => "Mín: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "Falha na autenticação. ${state_error}"; String failed_authentication(String state_error) => "Falha na autenticação. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} blocos restantes"; String Blocks_remaining(String status) => "${status} blocos restantes";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "A troca por ${provider} não é criada. Falha no carregamento dos limites"; String error_text_limits_loading_failed(String provider) => "A troca por ${provider} não é criada. Falha no carregamento dos limites";
@override @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 @override
String commit_transaction_amount_fee(String amount, String fee) => "Confirmar transação\nQuantia: ${amount}\nTaxa: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "Confirmar transação\nQuantia: ${amount}\nTaxa: ${fee}";
@override @override
@ -3490,6 +3534,8 @@ class $uk extends S {
@override @override
String get trade_state_underpaid => "Недоплачена"; String get trade_state_underpaid => "Недоплачена";
@override @override
String get refund_address => "Адреса повернення коштів";
@override
String get welcome => "Вітаємо в"; String get welcome => "Вітаємо в";
@override @override
String get share_address => "Поділитися адресою"; String get share_address => "Поділитися адресою";
@ -3698,7 +3744,7 @@ class $uk extends S {
@override @override
String get estimated => "Приблизно "; String get estimated => "Приблизно ";
@override @override
String get filters => "Фільтри"; String get filters => "Фільтр";
@override @override
String get settings_current_node => "Поточний вузол"; String get settings_current_node => "Поточний вузол";
@override @override
@ -3800,6 +3846,8 @@ class $uk extends S {
@override @override
String get sync_status_syncronized => "СИНХРОНІЗОВАНИЙ"; String get sync_status_syncronized => "СИНХРОНІЗОВАНИЙ";
@override @override
String get template => "Шаблон";
@override
String get transaction_priority_medium => "Середній"; String get transaction_priority_medium => "Середній";
@override @override
String get transaction_details_transaction_id => "ID транзакції"; String get transaction_details_transaction_id => "ID транзакції";
@ -3848,6 +3896,8 @@ class $uk extends S {
@override @override
String get trade_not_created => "Операція не створена."; String get trade_not_created => "Операція не створена.";
@override @override
String get confirm_delete_wallet => "Ця дія видалить гаманець. Ви хочете продовжити?";
@override
String get restore_wallet_name => "Ім'я гаманця"; String get restore_wallet_name => "Ім'я гаманця";
@override @override
String get widgets_seed => "Мнемонічна фраза"; String get widgets_seed => "Мнемонічна фраза";
@ -3856,6 +3906,8 @@ class $uk extends S {
@override @override
String get rename => "Перейменувати"; String get rename => "Перейменувати";
@override @override
String get confirm_delete_template => "Ця дія видалить шаблон. Ви хочете продовжити?";
@override
String get restore_active_seed => "Активна мнемонічна фраза"; String get restore_active_seed => "Активна мнемонічна фраза";
@override @override
String get send_name => "Ім'я"; String get send_name => "Ім'я";
@ -3918,7 +3970,7 @@ class $uk extends S {
@override @override
String get send => "Відправити"; String get send => "Відправити";
@override @override
String get send_title => "Відправити Monero"; String get send_title => "Відправити";
@override @override
String get error_text_keys => "Ключі гаманця можуть містити тільки 64 символів в hex"; String get error_text_keys => "Ключі гаманця можуть містити тільки 64 символів в hex";
@override @override
@ -4002,8 +4054,6 @@ class $uk extends S {
@override @override
String get restore_description_from_backup => "Ви можете відновити Cake Wallet з вашого резервного файлу"; String get restore_description_from_backup => "Ви можете відновити Cake Wallet з вашого резервного файлу";
@override @override
String get send_monero_address => "Monero адреса";
@override
String get error_text_node_port => "Порт вузла може містити тільки цифри від 0 до 65535"; String get error_text_node_port => "Порт вузла може містити тільки цифри від 0 до 65535";
@override @override
String get add_new_word => "Добавити нове слово"; String get add_new_word => "Добавити нове слово";
@ -4050,17 +4100,19 @@ class $uk extends S {
@override @override
String error_text_maximum_limit(String provider, String max, String currency) => "Операція для ${provider} не створена. Сума більше максимальної: ${max} ${currency}"; String error_text_maximum_limit(String provider, String max, String currency) => "Операція для ${provider} не створена. Сума більше максимальної: ${max} ${currency}";
@override @override
String send_address(String cryptoCurrency) => "${cryptoCurrency} адреса";
@override
String min_value(String value, String currency) => "Мін: ${value} ${currency}"; String min_value(String value, String currency) => "Мін: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "Помилка аутентифікації. ${state_error}"; String failed_authentication(String state_error) => "Помилка аутентифікації. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} Залишилось блоків"; String Blocks_remaining(String status) => "${status} Залишилось блоків";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "Операція для ${provider} не створена. Помилка завантаження лімітів"; String error_text_limits_loading_failed(String provider) => "Операція для ${provider} не створена. Помилка завантаження лімітів";
@override @override
String exchange_result_description(String fetchingLabel, String from) => "Будь ласка, відправте ${fetchingLabel} ${from} на адресу, вказану вище.\n\n'"; String exchange_result_description(String fetchingLabel, String from) => "Будь ласка, відправте ${fetchingLabel} ${from} на адресу, вказану вище.";
@override @override
String commit_transaction_amount_fee(String amount, String fee) => "Підтвердити транзакцію \nСума: ${amount}\nКомісія: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "Підтвердити транзакцію \nСума: ${amount}\nКомісія: ${fee}";
@override @override
@ -4114,6 +4166,8 @@ class $ja extends S {
@override @override
String get trade_state_underpaid => "支払不足"; String get trade_state_underpaid => "支払不足";
@override @override
String get refund_address => "払い戻し住所";
@override
String get welcome => "ようこそ に"; String get welcome => "ようこそ に";
@override @override
String get share_address => "住所を共有する"; String get share_address => "住所を共有する";
@ -4322,7 +4376,7 @@ class $ja extends S {
@override @override
String get estimated => "推定"; String get estimated => "推定";
@override @override
String get filters => "フィルタ"; String get filters => "フィルタ";
@override @override
String get settings_current_node => "現在のノード"; String get settings_current_node => "現在のノード";
@override @override
@ -4424,6 +4478,8 @@ class $ja extends S {
@override @override
String get sync_status_syncronized => "同期された"; String get sync_status_syncronized => "同期された";
@override @override
String get template => "テンプレート";
@override
String get transaction_priority_medium => ""; String get transaction_priority_medium => "";
@override @override
String get transaction_details_transaction_id => "トランザクションID"; String get transaction_details_transaction_id => "トランザクションID";
@ -4472,6 +4528,8 @@ class $ja extends S {
@override @override
String get trade_not_created => "作成されていない取引"; String get trade_not_created => "作成されていない取引";
@override @override
String get confirm_delete_wallet => "このアクションにより、このウォレットが削除されます。 続行しますか?";
@override
String get restore_wallet_name => "ウォレット名"; String get restore_wallet_name => "ウォレット名";
@override @override
String get widgets_seed => "シード"; String get widgets_seed => "シード";
@ -4480,6 +4538,8 @@ class $ja extends S {
@override @override
String get rename => "リネーム"; String get rename => "リネーム";
@override @override
String get confirm_delete_template => "この操作により、このテンプレートが削除されます。 続行しますか?";
@override
String get restore_active_seed => "アクティブシード"; String get restore_active_seed => "アクティブシード";
@override @override
String get send_name => "名前"; String get send_name => "名前";
@ -4542,7 +4602,7 @@ class $ja extends S {
@override @override
String get send => "送る"; String get send => "送る";
@override @override
String get send_title => "Moneroを送信"; String get send_title => "を送信";
@override @override
String get error_text_keys => "ウォレットキーには、16進数で64文字しか含めることができません"; String get error_text_keys => "ウォレットキーには、16進数で64文字しか含めることができません";
@override @override
@ -4626,8 +4686,6 @@ class $ja extends S {
@override @override
String get restore_description_from_backup => "Cake Walletアプリ全体を復元できますバックアップファイル"; String get restore_description_from_backup => "Cake Walletアプリ全体を復元できますバックアップファイル";
@override @override
String get send_monero_address => "Monero 住所";
@override
String get error_text_node_port => "ードポートには、0〜65535の数字のみを含めることができます"; String get error_text_node_port => "ードポートには、0〜65535の数字のみを含めることができます";
@override @override
String get add_new_word => "新しい単語を追加"; String get add_new_word => "新しい単語を追加";
@ -4674,17 +4732,19 @@ class $ja extends S {
@override @override
String error_text_maximum_limit(String provider, String max, String currency) => "${provider} の取引は作成されません。 金額は最大値を超えています: ${max} ${currency}"; String error_text_maximum_limit(String provider, String max, String currency) => "${provider} の取引は作成されません。 金額は最大値を超えています: ${max} ${currency}";
@override @override
String send_address(String cryptoCurrency) => "${cryptoCurrency} 住所";
@override
String min_value(String value, String currency) => "分: ${value} ${currency}"; String min_value(String value, String currency) => "分: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "認証失敗. ${state_error}"; String failed_authentication(String state_error) => "認証失敗. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} 残りのブロック"; String Blocks_remaining(String status) => "${status} 残りのブロック";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "${provider} の取引は作成されません。 制限の読み込みに失敗しました"; String error_text_limits_loading_failed(String provider) => "${provider} の取引は作成されません。 制限の読み込みに失敗しました";
@override @override
String exchange_result_description(String fetchingLabel, String from) => "送信してください ${fetchingLabel} ${from} 上記のアドレスへ.\n\n'"; String exchange_result_description(String fetchingLabel, String from) => "送信してください ${fetchingLabel} ${from} 上記のアドレスへ.";
@override @override
String commit_transaction_amount_fee(String amount, String fee) => "トランザクションをコミット\n量: ${amount}\n費用: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "トランザクションをコミット\n量: ${amount}\n費用: ${fee}";
@override @override
@ -4742,6 +4802,8 @@ class $pl extends S {
@override @override
String get trade_state_underpaid => "Niedopłacone"; String get trade_state_underpaid => "Niedopłacone";
@override @override
String get refund_address => "Adres zwrotu";
@override
String get welcome => "Witamy w"; String get welcome => "Witamy w";
@override @override
String get share_address => "Udostępnij adres"; String get share_address => "Udostępnij adres";
@ -4950,7 +5012,7 @@ class $pl extends S {
@override @override
String get estimated => "Oszacowano"; String get estimated => "Oszacowano";
@override @override
String get filters => "Filtry"; String get filters => "Filtr";
@override @override
String get settings_current_node => "Bieżący węzeł"; String get settings_current_node => "Bieżący węzeł";
@override @override
@ -5052,6 +5114,8 @@ class $pl extends S {
@override @override
String get sync_status_syncronized => "SYNCHRONIZOWANY"; String get sync_status_syncronized => "SYNCHRONIZOWANY";
@override @override
String get template => "Szablon";
@override
String get transaction_priority_medium => "Średni"; String get transaction_priority_medium => "Średni";
@override @override
String get transaction_details_transaction_id => "Transakcja ID"; String get transaction_details_transaction_id => "Transakcja ID";
@ -5100,6 +5164,8 @@ class $pl extends S {
@override @override
String get trade_not_created => "Handel nie utworzony."; String get trade_not_created => "Handel nie utworzony.";
@override @override
String get confirm_delete_wallet => "Ta czynność usunie ten portfel. Czy chcesz kontynuować?";
@override
String get restore_wallet_name => "Nazwa portfela"; String get restore_wallet_name => "Nazwa portfela";
@override @override
String get widgets_seed => "Ziarno"; String get widgets_seed => "Ziarno";
@ -5108,6 +5174,8 @@ class $pl extends S {
@override @override
String get rename => "Przemianować"; String get rename => "Przemianować";
@override @override
String get confirm_delete_template => "Ta czynność usunie ten szablon. Czy chcesz kontynuować?";
@override
String get restore_active_seed => "Aktywne nasiona"; String get restore_active_seed => "Aktywne nasiona";
@override @override
String get send_name => "Imię"; String get send_name => "Imię";
@ -5170,7 +5238,7 @@ class $pl extends S {
@override @override
String get send => "Wysłać"; String get send => "Wysłać";
@override @override
String get send_title => "Wyślij Monero"; String get send_title => "Wyślij";
@override @override
String get error_text_keys => "Klucze portfela mogą zawierać tylko 64 znaki w systemie szesnastkowym"; String get error_text_keys => "Klucze portfela mogą zawierać tylko 64 znaki w systemie szesnastkowym";
@override @override
@ -5254,8 +5322,6 @@ class $pl extends S {
@override @override
String get restore_description_from_backup => "Możesz przywrócić całą aplikację Cake Wallet z plik kopii zapasowej"; String get restore_description_from_backup => "Możesz przywrócić całą aplikację Cake Wallet z plik kopii zapasowej";
@override @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"; String get error_text_node_port => "Port węzła może zawierać tylko liczby od 0 do 65535";
@override @override
String get add_new_word => "Dodaj nowe słowo"; String get add_new_word => "Dodaj nowe słowo";
@ -5302,17 +5368,19 @@ class $pl extends S {
@override @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}"; 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 @override
String send_address(String cryptoCurrency) => "Adres ${cryptoCurrency}";
@override
String min_value(String value, String currency) => "Min: ${value} ${currency}"; String min_value(String value, String currency) => "Min: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "Nieudane uwierzytelnienie. ${state_error}"; String failed_authentication(String state_error) => "Nieudane uwierzytelnienie. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} Bloki pozostałe"; String Blocks_remaining(String status) => "${status} Bloki pozostałe";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "Wymiana dla ${provider} nie została utworzona. Ładowanie limitów nie powiodło się"; String error_text_limits_loading_failed(String provider) => "Wymiana dla ${provider} nie została utworzona. Ładowanie limitów nie powiodło się";
@override @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 @override
String commit_transaction_amount_fee(String amount, String fee) => "Zatwierdź transakcję\nIlość: ${amount}\nOpłata: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "Zatwierdź transakcję\nIlość: ${amount}\nOpłata: ${fee}";
@override @override
@ -5366,6 +5434,8 @@ class $es extends S {
@override @override
String get trade_state_underpaid => "Poco pagado"; String get trade_state_underpaid => "Poco pagado";
@override @override
String get refund_address => "Dirección de reembolso";
@override
String get welcome => "Bienvenido"; String get welcome => "Bienvenido";
@override @override
String get share_address => "Compartir dirección"; String get share_address => "Compartir dirección";
@ -5574,7 +5644,7 @@ class $es extends S {
@override @override
String get estimated => "Estimado"; String get estimated => "Estimado";
@override @override
String get filters => "Filtros"; String get filters => "Filtrar";
@override @override
String get settings_current_node => "Nodo actual"; String get settings_current_node => "Nodo actual";
@override @override
@ -5676,6 +5746,8 @@ class $es extends S {
@override @override
String get sync_status_syncronized => "SINCRONIZADO"; String get sync_status_syncronized => "SINCRONIZADO";
@override @override
String get template => "Plantilla";
@override
String get transaction_priority_medium => "Medio"; String get transaction_priority_medium => "Medio";
@override @override
String get transaction_details_transaction_id => "ID de transacción"; String get transaction_details_transaction_id => "ID de transacción";
@ -5724,6 +5796,8 @@ class $es extends S {
@override @override
String get trade_not_created => "Comercio no se crea."; String get trade_not_created => "Comercio no se crea.";
@override @override
String get confirm_delete_wallet => "Esta acción eliminará esta billetera. ¿Desea continuar?";
@override
String get restore_wallet_name => "Nombre de la billetera"; String get restore_wallet_name => "Nombre de la billetera";
@override @override
String get widgets_seed => "Semilla"; String get widgets_seed => "Semilla";
@ -5732,6 +5806,8 @@ class $es extends S {
@override @override
String get rename => "Rebautizar"; String get rename => "Rebautizar";
@override @override
String get confirm_delete_template => "Esta acción eliminará esta plantilla. ¿Desea continuar?";
@override
String get restore_active_seed => "Semilla activa"; String get restore_active_seed => "Semilla activa";
@override @override
String get send_name => "Nombre"; String get send_name => "Nombre";
@ -5794,7 +5870,7 @@ class $es extends S {
@override @override
String get send => "Enviar"; String get send => "Enviar";
@override @override
String get send_title => "Enviar Monero"; String get send_title => "Enviar";
@override @override
String get error_text_keys => "Las llaves de billetera solo pueden contener 64 caracteres en hexadecimal"; String get error_text_keys => "Las llaves de billetera solo pueden contener 64 caracteres en hexadecimal";
@override @override
@ -5878,8 +5954,6 @@ class $es extends S {
@override @override
String get restore_description_from_backup => "Puede restaurar toda la aplicación Cake Wallet desde ysu archivo de respaldo"; String get restore_description_from_backup => "Puede restaurar toda la aplicación Cake Wallet desde ysu archivo de respaldo";
@override @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"; String get error_text_node_port => "El puerto de nodo solo puede contener números entre 0 y 65535";
@override @override
String get add_new_word => "Agregar palabra nueva"; String get add_new_word => "Agregar palabra nueva";
@ -5926,17 +6000,19 @@ class $es extends S {
@override @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}"; 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 @override
String send_address(String cryptoCurrency) => "Dirección de ${cryptoCurrency}";
@override
String min_value(String value, String currency) => "Min: ${value} ${currency}"; String min_value(String value, String currency) => "Min: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "Autenticación fallida. ${state_error}"; String failed_authentication(String state_error) => "Autenticación fallida. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} Bloques restantes"; String Blocks_remaining(String status) => "${status} Bloques restantes";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "El comercio por ${provider} no se crea. Límites de carga fallidos"; String error_text_limits_loading_failed(String provider) => "El comercio por ${provider} no se crea. Límites de carga fallidos";
@override @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 @override
String commit_transaction_amount_fee(String amount, String fee) => "Confirmar transacción\nCantidad: ${amount}\nCuota: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "Confirmar transacción\nCantidad: ${amount}\nCuota: ${fee}";
@override @override
@ -5990,6 +6066,8 @@ class $nl extends S {
@override @override
String get trade_state_underpaid => "Slecht betaald"; String get trade_state_underpaid => "Slecht betaald";
@override @override
String get refund_address => "Adres voor terugbetaling";
@override
String get welcome => "Welkom bij"; String get welcome => "Welkom bij";
@override @override
String get share_address => "Deel adres"; String get share_address => "Deel adres";
@ -6198,7 +6276,7 @@ class $nl extends S {
@override @override
String get estimated => "Geschatte"; String get estimated => "Geschatte";
@override @override
String get filters => "Filters"; String get filters => "Filter";
@override @override
String get settings_current_node => "Huidige knooppunt"; String get settings_current_node => "Huidige knooppunt";
@override @override
@ -6300,6 +6378,8 @@ class $nl extends S {
@override @override
String get sync_status_syncronized => "SYNCHRONIZED"; String get sync_status_syncronized => "SYNCHRONIZED";
@override @override
String get template => "Sjabloon";
@override
String get transaction_priority_medium => "Medium"; String get transaction_priority_medium => "Medium";
@override @override
String get transaction_details_transaction_id => "Transactie ID"; String get transaction_details_transaction_id => "Transactie ID";
@ -6348,6 +6428,8 @@ class $nl extends S {
@override @override
String get trade_not_created => "Handel niet gecreëerd."; String get trade_not_created => "Handel niet gecreëerd.";
@override @override
String get confirm_delete_wallet => "Met deze actie wordt deze portemonnee verwijderd. Wilt u doorgaan?";
@override
String get restore_wallet_name => "Portemonnee naam"; String get restore_wallet_name => "Portemonnee naam";
@override @override
String get widgets_seed => "Zaad"; String get widgets_seed => "Zaad";
@ -6356,6 +6438,8 @@ class $nl extends S {
@override @override
String get rename => "Hernoemen"; String get rename => "Hernoemen";
@override @override
String get confirm_delete_template => "Met deze actie wordt deze sjabloon verwijderd. Wilt u doorgaan?";
@override
String get restore_active_seed => "Actief zaad"; String get restore_active_seed => "Actief zaad";
@override @override
String get send_name => "Naam"; String get send_name => "Naam";
@ -6418,7 +6502,7 @@ class $nl extends S {
@override @override
String get send => "Sturen"; String get send => "Sturen";
@override @override
String get send_title => "Stuur Monero"; String get send_title => "Stuur";
@override @override
String get error_text_keys => "Portefeuillesleutels kunnen maximaal 64 tekens bevatten in hexadecimale volgorde"; String get error_text_keys => "Portefeuillesleutels kunnen maximaal 64 tekens bevatten in hexadecimale volgorde";
@override @override
@ -6502,8 +6586,6 @@ class $nl extends S {
@override @override
String get restore_description_from_backup => "Je kunt de hele Cake Wallet-app herstellen van uw back-upbestand"; String get restore_description_from_backup => "Je kunt de hele Cake Wallet-app herstellen van uw back-upbestand";
@override @override
String get send_monero_address => "Monero-adres";
@override
String get error_text_node_port => "Knooppuntpoort kan alleen nummers tussen 0 en 65535 bevatten"; String get error_text_node_port => "Knooppuntpoort kan alleen nummers tussen 0 en 65535 bevatten";
@override @override
String get add_new_word => "Nieuw woord toevoegen"; String get add_new_word => "Nieuw woord toevoegen";
@ -6550,17 +6632,19 @@ class $nl extends S {
@override @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}"; 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 @override
String send_address(String cryptoCurrency) => "${cryptoCurrency}-adres";
@override
String min_value(String value, String currency) => "Min: ${value} ${currency}"; String min_value(String value, String currency) => "Min: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "Mislukte authenticatie. ${state_error}"; String failed_authentication(String state_error) => "Mislukte authenticatie. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} Resterende blokken"; String Blocks_remaining(String status) => "${status} Resterende blokken";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "Ruil voor ${provider} is niet gemaakt. Beperkingen laden mislukt"; String error_text_limits_loading_failed(String provider) => "Ruil voor ${provider} is niet gemaakt. Beperkingen laden mislukt";
@override @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 @override
String commit_transaction_amount_fee(String amount, String fee) => "Verricht transactie\nBedrag: ${amount}\nhonorarium: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "Verricht transactie\nBedrag: ${amount}\nhonorarium: ${fee}";
@override @override
@ -6614,6 +6698,8 @@ class $zh extends S {
@override @override
String get trade_state_underpaid => "支付不足"; String get trade_state_underpaid => "支付不足";
@override @override
String get refund_address => "退款地址";
@override
String get welcome => "歡迎來到"; String get welcome => "歡迎來到";
@override @override
String get share_address => "分享地址"; String get share_address => "分享地址";
@ -6822,7 +6908,7 @@ class $zh extends S {
@override @override
String get estimated => "估计的"; String get estimated => "估计的";
@override @override
String get filters => "筛选器"; String get filters => "過濾";
@override @override
String get settings_current_node => "当前节点"; String get settings_current_node => "当前节点";
@override @override
@ -6924,6 +7010,8 @@ class $zh extends S {
@override @override
String get sync_status_syncronized => "已同步"; String get sync_status_syncronized => "已同步";
@override @override
String get template => "模板";
@override
String get transaction_priority_medium => "介质"; String get transaction_priority_medium => "介质";
@override @override
String get transaction_details_transaction_id => "交易编号"; String get transaction_details_transaction_id => "交易编号";
@ -6972,6 +7060,8 @@ class $zh extends S {
@override @override
String get trade_not_created => "未建立交易."; String get trade_not_created => "未建立交易.";
@override @override
String get confirm_delete_wallet => "此操作將刪除此錢包。 你想繼續嗎?";
@override
String get restore_wallet_name => "钱包名称"; String get restore_wallet_name => "钱包名称";
@override @override
String get widgets_seed => "种子"; String get widgets_seed => "种子";
@ -6980,6 +7070,8 @@ class $zh extends S {
@override @override
String get rename => "改名"; String get rename => "改名";
@override @override
String get confirm_delete_template => "此操作將刪除此模板。 你想繼續嗎?";
@override
String get restore_active_seed => "活性種子"; String get restore_active_seed => "活性種子";
@override @override
String get send_name => "名稱"; String get send_name => "名稱";
@ -7042,7 +7134,7 @@ class $zh extends S {
@override @override
String get send => "发送"; String get send => "发送";
@override @override
String get send_title => "发送门罗币"; String get send_title => "發送";
@override @override
String get error_text_keys => "钱包密钥只能包含16个字符的十六进制字符"; String get error_text_keys => "钱包密钥只能包含16个字符的十六进制字符";
@override @override
@ -7126,8 +7218,6 @@ class $zh extends S {
@override @override
String get restore_description_from_backup => "您可以从还原整个Cake Wallet应用您的备份文件"; String get restore_description_from_backup => "您可以从还原整个Cake Wallet应用您的备份文件";
@override @override
String get send_monero_address => "门罗地址";
@override
String get error_text_node_port => "节点端口只能包含0到65535之间的数字"; String get error_text_node_port => "节点端口只能包含0到65535之间的数字";
@override @override
String get add_new_word => "添加新词"; String get add_new_word => "添加新词";
@ -7174,17 +7264,19 @@ class $zh extends S {
@override @override
String error_text_maximum_limit(String provider, String max, String currency) => "未創建 ${provider} 交易。 金額大於最大值:${max} ${currency}"; String error_text_maximum_limit(String provider, String max, String currency) => "未創建 ${provider} 交易。 金額大於最大值:${max} ${currency}";
@override @override
String send_address(String cryptoCurrency) => "${cryptoCurrency} 地址";
@override
String min_value(String value, String currency) => "敏: ${value} ${currency}"; String min_value(String value, String currency) => "敏: ${value} ${currency}";
@override @override
String failed_authentication(String state_error) => "身份验证失败. ${state_error}"; String failed_authentication(String state_error) => "身份验证失败. ${state_error}";
@override @override
String Blocks_remaining(String status) => "${status} 剩余的块"; String Blocks_remaining(String status) => "${status} 剩余的块";
@override @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 @override
String error_text_limits_loading_failed(String provider) => "未創建 ${provider} 交易。 限制加載失敗"; String error_text_limits_loading_failed(String provider) => "未創建 ${provider} 交易。 限制加載失敗";
@override @override
String exchange_result_description(String fetchingLabel, String from) => "请发送 ${fetchingLabel} ${from} 到上面显示的地址.\n\n'"; String exchange_result_description(String fetchingLabel, String from) => "请发送 ${fetchingLabel} ${from} 到上面显示的地址.";
@override @override
String commit_transaction_amount_fee(String amount, String fee) => "提交交易\n量: ${amount}\nFee: ${fee}"; String commit_transaction_amount_fee(String amount, String fee) => "提交交易\n量: ${amount}\nFee: ${fee}";
@override @override

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/reactions/bootstrap.dart'; 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/store/authentication_store.dart';
import 'package:cake_wallet/core/auth_service.dart'; import 'package:cake_wallet/core/auth_service.dart';
import 'package:cake_wallet/bitcoin/bitcoin_wallet_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/domain/common/language.dart';
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart'; import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
bool isThemeChangerRegistered = false;
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
@ -127,6 +130,8 @@ void main() async {
contactSource: contacts, contactSource: contacts,
tradesSource: trades, tradesSource: trades,
fiatConvertationService: fiatConvertationService, fiatConvertationService: fiatConvertationService,
templates: templates,
exchangeTemplates: exchangeTemplates,
initialMigrationVersion: 4); initialMigrationVersion: 4);
setReactions( setReactions(
@ -167,9 +172,11 @@ Future<void> initialSetup(
@required Box<Node> nodes, @required Box<Node> nodes,
@required Box<WalletInfo> walletInfoSource, @required Box<WalletInfo> walletInfoSource,
@required Box<Contact> contactSource, @required Box<Contact> contactSource,
@required Box<Trade> tradesSource, @required Box<Trade> tradesSource,
@required FiatConvertationService fiatConvertationService, @required FiatConvertationService fiatConvertationService,
int initialMigrationVersion = 4}) async { @required Box<Template> templates,
@required Box<ExchangeTemplate> exchangeTemplates,
int initialMigrationVersion = 4}) async {
await defaultSettingsMigration( await defaultSettingsMigration(
version: initialMigrationVersion, version: initialMigrationVersion,
sharedPreferences: sharedPreferences, sharedPreferences: sharedPreferences,
@ -178,7 +185,9 @@ Future<void> initialSetup(
walletInfoSource: walletInfoSource, walletInfoSource: walletInfoSource,
nodeSource: nodes, nodeSource: nodes,
contactSource: contactSource, contactSource: contactSource,
tradesSource: tradesSource); tradesSource: tradesSource,
templates: templates,
exchangeTemplates: exchangeTemplates);
await bootstrap(fiatConvertationService: fiatConvertationService); await bootstrap(fiatConvertationService: fiatConvertationService);
monero_wallet.onStartup(); monero_wallet.onStartup();
} }
@ -191,7 +200,8 @@ class CakeWalletApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { 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>( return ChangeNotifierProvider<ThemeChanger>(
create: (_) => ThemeChanger( create: (_) => ThemeChanger(
@ -222,12 +232,20 @@ class MaterialAppWithTheme extends StatelessWidget {
final transactionDescriptions = final transactionDescriptions =
Provider.of<Box<TransactionDescription>>(context); Provider.of<Box<TransactionDescription>>(context);
final statusBarColor = if (!isThemeChangerRegistered) {
settingsStore.isDarkTheme ? Colors.black : Colors.white; setupThemeChangerStore(theme);
isThemeChangerRegistered = true;
}
/*final statusBarColor =
settingsStore.isDarkTheme ? Colors.black : Colors.white;*/
final _settingsStore = getIt.get<AppStore>().settingsStore;
final statusBarColor = Colors.transparent;
final statusBarBrightness = final statusBarBrightness =
settingsStore.isDarkTheme ? Brightness.light : Brightness.dark; _settingsStore.isDarkTheme ? Brightness.light : Brightness.dark;
final statusBarIconBrightness = final statusBarIconBrightness =
settingsStore.isDarkTheme ? Brightness.light : Brightness.dark; _settingsStore.isDarkTheme ? Brightness.light : Brightness.dark;
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: statusBarColor, statusBarColor: statusBarColor,
@ -264,4 +282,4 @@ class MaterialAppWithTheme extends StatelessWidget {
authenticationStore: getIt.get<AuthenticationStore>(), authenticationStore: getIt.get<AuthenticationStore>(),
)); ));
} }
} }

View file

@ -3,15 +3,45 @@ import 'package:flutter/material.dart';
class Palette { class Palette {
static const Color green = Color.fromRGBO(39, 206, 80, 1.0); 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 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 blueAlice = Color.fromRGBO(231, 240, 253, 1.0);
static const Color lightBlue = Color.fromRGBO(172, 203, 238, 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 lavender = Color.fromRGBO(237, 245, 252, 1.0);
static const Color oceanBlue = Color.fromRGBO(30, 52, 78, 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 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 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 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. // FIXME: Rename.
static const Color eee = Color.fromRGBO(236, 239, 245, 1.0); static const Color eee = Color.fromRGBO(236, 239, 245, 1.0);
static const Color xxx = Color.fromRGBO(72, 89, 109, 1); 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 distantBlue = Color.fromRGBO(70, 85, 133, 1.0); // mainBackgroundColor
static const Color lightDistantBlue = Color.fromRGBO(81, 96, 147, 1.0); // borderCardColor 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 gray = Color.fromRGBO(140, 153, 201, 1.0); // walletCardText
static const Color moderateBlue = Color.fromRGBO(63, 77, 122, 1.0); // walletCardSubAddressField //static const Color violetBlue = Color.fromRGBO(51, 63, 104, 1.0); // walletCardAddressField
static const Color darkNightBlue = Color.fromRGBO(33, 43, 73, 1.0); // historyPanel //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 pigeonBlue = Color.fromRGBO(91, 112, 146, 1.0); // historyPanelText
static const Color moderateNightBlue = Color.fromRGBO(39, 53, 96, 1.0); // historyPanelButton static const Color moderateNightBlue = Color.fromRGBO(39, 53, 96, 1.0); // historyPanelButton
static const Color headerNightBlue = Color.fromRGBO(41, 52, 84, 1.0); // menuHeader 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 lightOceanBlue = Color.fromRGBO(32, 45, 80, 1.0);
static const Color lightNightBlue = Color.fromRGBO(39, 52, 89, 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 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 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 wildBlueGrey = Color.fromRGBO(125, 137, 182, 1.0);
static const Color darkGrey = Color.fromRGBO(118, 131, 169, 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 dividerColor = Color.fromRGBO(48, 59, 95, 1.0);
static const Color violetBlue = Color.fromRGBO(59, 72, 119, 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 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. // FIXME: Rename.
static const Color eee = Color.fromRGBO(236, 239, 245, 1.0); static const Color eee = Color.fromRGBO(236, 239, 245, 1.0);

View file

@ -258,12 +258,7 @@ class Router {
case Routes.sendTemplate: case Routes.sendTemplate:
return CupertinoPageRoute<void>( return CupertinoPageRoute<void>(
builder: (_) => Provider( fullscreenDialog: true, builder: (_) => getIt.get<SendTemplatePage>());
create: (_) => SendStore(
walletService: walletService,
priceStore: priceStore,
transactionDescriptions: transactionDescriptions),
child: SendTemplatePage()));
case Routes.receive: case Routes.receive:
return CupertinoPageRoute<void>( return CupertinoPageRoute<void>(
@ -363,7 +358,9 @@ class Router {
case Routes.exchangeTrade: case Routes.exchangeTrade:
return CupertinoPageRoute<void>( return CupertinoPageRoute<void>(
builder: (_) => MultiProvider( builder: (_) => getIt.get<ExchangeTradePage>());
/*MultiProvider(
providers: [ providers: [
ProxyProvider<SettingsStore, ExchangeTradeStore>( ProxyProvider<SettingsStore, ExchangeTradeStore>(
update: (_, settingsStore, __) => ExchangeTradeStore( update: (_, settingsStore, __) => ExchangeTradeStore(
@ -379,12 +376,13 @@ class Router {
priceStore: priceStore)), priceStore: priceStore)),
], ],
child: ExchangeTradePage(), child: ExchangeTradePage(),
)); ));*/
case Routes.exchangeConfirm: case Routes.exchangeConfirm:
return MaterialPageRoute<void>( return MaterialPageRoute<void>(
builder: (_) => builder: (_) => getIt.get<ExchangeConfirmPage>());
ExchangeConfirmPage(trade: settings.arguments as Trade));
//ExchangeConfirmPage(trade: settings.arguments as Trade));
case Routes.tradeDetails: case Routes.tradeDetails:
return MaterialPageRoute<void>(builder: (context) { return MaterialPageRoute<void>(builder: (context) {
@ -416,45 +414,12 @@ class Router {
walletRestorationFromSeedVM: walletRestorationFromSeedVM)); walletRestorationFromSeedVM: walletRestorationFromSeedVM));
case Routes.exchange: case Routes.exchange:
return MaterialPageRoute<void>( return CupertinoPageRoute<void>(
builder: (_) => MultiProvider(providers: [ builder: (_) => getIt.get<ExchangePage>());
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()));
case Routes.exchangeTemplate: case Routes.exchangeTemplate:
return MaterialPageRoute<void>( return CupertinoPageRoute<void>(
builder: (_) => Provider( builder: (_) => getIt.get<ExchangeTemplatePage>());
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(),
));
case Routes.settings: case Routes.settings:
return MaterialPageRoute<void>( return MaterialPageRoute<void>(

View file

@ -15,21 +15,26 @@ abstract class BasePage extends StatelessWidget {
Color get backgroundLightColor => Colors.white; Color get backgroundLightColor => Colors.white;
Color get backgroundDarkColor => PaletteDark.darkNightBlue; Color get backgroundDarkColor => PaletteDark.backgroundColor;
Color get titleColor => null;
bool get resizeToAvoidBottomPadding => true; bool get resizeToAvoidBottomPadding => true;
Widget get endDrawer => null;
AppBarStyle get appBarStyle => AppBarStyle.regular; AppBarStyle get appBarStyle => AppBarStyle.regular;
Widget Function(BuildContext, Widget) get rootWrapper => null; Widget Function(BuildContext, Widget) get rootWrapper => null;
final _backArrowImage = Image.asset('assets/images/back_arrow.png', color: Colors.white); final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
final _backArrowImageDarkTheme =
Image.asset('assets/images/back_arrow_dark_theme.png', color: Colors.white);
final _closeButtonImage = Image.asset('assets/images/close_button.png'); final _closeButtonImage = Image.asset('assets/images/close_button.png');
final _closeButtonImageDarkTheme = final _closeButtonImageDarkTheme =
Image.asset('assets/images/close_button_dark_theme.png'); Image.asset('assets/images/close_button_dark_theme.png');
void onOpenEndDrawer() => _scaffoldKey.currentState.openEndDrawer();
void onClose(BuildContext context) => Navigator.of(context).pop(); void onClose(BuildContext context) => Navigator.of(context).pop();
Widget leading(BuildContext context) { Widget leading(BuildContext context) {
@ -37,16 +42,13 @@ abstract class BasePage extends StatelessWidget {
return null; return null;
} }
final _themeChanger = Provider.of<ThemeChanger>(context); final _backButton = Image.asset('assets/images/back_arrow.png',
Image _closeButton, _backButton; color: titleColor ?? Theme.of(context).primaryTextTheme.title.color);
if (_themeChanger.getTheme() == Themes.darkTheme) { final _themeChanger = Provider.of<ThemeChanger>(context);
_backButton = _backArrowImageDarkTheme; final _closeButton = _themeChanger.getTheme() == Themes.darkTheme
_closeButton = _closeButtonImageDarkTheme; ? _closeButtonImageDarkTheme
} else { : _closeButtonImage;
_backButton = _backArrowImage;
_closeButton = _closeButtonImage;
}
return SizedBox( return SizedBox(
height: 37, height: 37,
@ -71,9 +73,8 @@ abstract class BasePage extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
//color: Theme.of(context).primaryTextTheme.title.color, color: titleColor ??
color: Colors.white, Theme.of(context).primaryTextTheme.title.color),
),
); );
} }
@ -123,9 +124,11 @@ abstract class BasePage extends StatelessWidget {
final _isDarkTheme = _themeChanger.getTheme() == Themes.darkTheme; final _isDarkTheme = _themeChanger.getTheme() == Themes.darkTheme;
final root = Scaffold( final root = Scaffold(
key: _scaffoldKey,
backgroundColor: backgroundColor:
_isDarkTheme ? backgroundDarkColor : backgroundLightColor, _isDarkTheme ? backgroundDarkColor : backgroundLightColor,
resizeToAvoidBottomPadding: resizeToAvoidBottomPadding, resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
endDrawer: endDrawer,
appBar: appBar(context), appBar: appBar(context),
body: body(context), //SafeArea(child: ), body: body(context), //SafeArea(child: ),
floatingActionButton: floatingActionButton(context)); floatingActionButton: floatingActionButton(context));

View file

@ -5,16 +5,13 @@ import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.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/base_page.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.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/action_button.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/balance_page.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/address_page.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/transactions_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/src/screens/dashboard/widgets/sync_indicator.dart';
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.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 { class DashboardPage extends BasePage {
DashboardPage({ DashboardPage({
@ -23,14 +20,28 @@ class DashboardPage extends BasePage {
}); });
@override @override
Color get backgroundLightColor => PaletteDark.backgroundColor; Color get backgroundLightColor => Colors.transparent;
@override @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 @override
bool get resizeToAvoidBottomPadding => false; bool get resizeToAvoidBottomPadding => false;
@override
Widget get endDrawer => MenuWidget(walletViewModel);
@override @override
Widget middle(BuildContext context) { Widget middle(BuildContext context) {
return SyncIndicator(dashboardViewModel: walletViewModel); return SyncIndicator(dashboardViewModel: walletViewModel);
@ -38,24 +49,18 @@ class DashboardPage extends BasePage {
@override @override
Widget trailing(BuildContext context) { Widget trailing(BuildContext context) {
final menuButton = Image.asset('assets/images/menu.png', final menuButton =
color: Colors.white); Image.asset('assets/images/menu.png', color: Colors.white);
return Container( return Container(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
width: 40, width: 40,
child: FlatButton( child: FlatButton(
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
splashColor: Colors.transparent, splashColor: Colors.transparent,
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
onPressed: () async { onPressed: () => onOpenEndDrawer(),
await showDialog<void>( child: menuButton));
builder: (_) => MenuWidget(walletViewModel),
context: context);
},
child: menuButton
)
);
} }
final DashboardViewModel walletViewModel; final DashboardViewModel walletViewModel;
@ -73,79 +78,64 @@ class DashboardPage extends BasePage {
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
_setEffects(); _setEffects();
return SafeArea( return SafeArea(
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: PageView.builder( child: PageView.builder(
controller: controller,
itemCount: pages.length,
itemBuilder: (context, index) {
return pages[index];
})),
Padding(
padding: EdgeInsets.only(bottom: 24),
child: SmoothPageIndicator(
controller: controller, controller: controller,
itemCount: pages.length, count: pages.length,
itemBuilder: (context, index) { effect: ColorTransitionEffect(
return pages[index]; spacing: 6.0,
} radius: 6.0,
) dotWidth: 6.0,
), dotHeight: 6.0,
Padding( dotColor: Theme.of(context).indicatorColor,
padding: EdgeInsets.only( activeDotColor: Colors.white),
bottom: 24 )),
), Container(
child: Observer( width: double.infinity,
builder: (_) { padding: EdgeInsets.only(left: 45, right: 45, bottom: 24),
return DotsIndicator( child: Row(
dotsCount: pages.length, children: <Widget>[
position: walletViewModel.currentPage, Flexible(
decorator: DotsDecorator( child: ActionButton(
color: PaletteDark.cyanBlue, image: sendImage,
activeColor: Colors.white, title: S.of(context).send,
size: Size(6, 6), route: Routes.send,
activeSize: Size(6, 6), alignment: Alignment.centerLeft,
),
);
}
),
),
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, image: exchangeImage,
title: S.of(context).exchange, 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() { void _setEffects() {
@ -157,16 +147,6 @@ class DashboardPage extends BasePage {
pages.add(BalancePage(dashboardViewModel: walletViewModel)); pages.add(BalancePage(dashboardViewModel: walletViewModel));
pages.add(TransactionsPage(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; _isEffectsInstalled = true;
} }
} }

View file

@ -22,13 +22,13 @@ class WalletMenu {
]; ];
final List<Image> images = [ final List<Image> images = [
Image.asset('assets/images/reconnect.png'), Image.asset('assets/images/reconnect_menu.png', height: 16, width: 16),
Image.asset('assets/images/wallet.png'), Image.asset('assets/images/wallet_menu.png', height: 16, width: 16),
Image.asset('assets/images/nodes.png'), Image.asset('assets/images/nodes_menu.png', height: 16, width: 16),
Image.asset('assets/images/eye.png'), Image.asset('assets/images/eye_menu.png', height: 16, width: 16),
Image.asset('assets/images/key.png'), Image.asset('assets/images/key_menu.png', height: 16, width: 16),
Image.asset('assets/images/open_book.png'), Image.asset('assets/images/open_book_menu.png', height: 16, width: 16),
Image.asset('assets/images/settings.png'), Image.asset('assets/images/settings_menu.png', height: 16, width: 16),
]; ];
final BuildContext context; final BuildContext context;

View file

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
class ActionButton extends StatelessWidget{ class ActionButton extends StatelessWidget{
ActionButton({ ActionButton({
@ -36,7 +35,7 @@ class ActionButton extends StatelessWidget{
width: 60, width: 60,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: PaletteDark.nightBlue, color: Theme.of(context).buttonColor,
shape: BoxShape.circle), shape: BoxShape.circle),
child: image, child: image,
), ),

View file

@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.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/src/screens/receive/widgets/qr_widget.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
@ -29,7 +28,11 @@ class AddressPage extends StatelessWidget {
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(25)), 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( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,

View file

@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.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'; import 'package:flutter_mobx/flutter_mobx.dart';
class BalancePage extends StatelessWidget { class BalancePage extends StatelessWidget {
@ -26,7 +25,7 @@ class BalancePage extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 40, fontSize: 40,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: PaletteDark.cyanBlue, color: Theme.of(context).indicatorColor,
height: 1 height: 1
), ),
); );
@ -52,7 +51,7 @@ class BalancePage extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: PaletteDark.cyanBlue, color: Theme.of(context).indicatorColor,
height: 1 height: 1
), ),
); );

View file

@ -3,7 +3,6 @@ import 'package:intl/intl.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:cake_wallet/src/stores/settings/settings_store.dart'; import 'package:cake_wallet/src/stores/settings/settings_store.dart';
import 'package:cake_wallet/palette.dart';
class DateSectionRaw extends StatelessWidget { class DateSectionRaw extends StatelessWidget {
DateSectionRaw({this.date}); DateSectionRaw({this.date});
@ -42,7 +41,7 @@ class DateSectionRaw extends StatelessWidget {
child: Text(title, child: Text(title,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: PaletteDark.darkCyanBlue color: Theme.of(context).textTheme.overline.backgroundColor
)) ))
); );
} }

View 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,
);
}
}

View 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)
],
),
);
}
}

View file

@ -1,21 +1,18 @@
import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.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 { class HeaderRow extends StatelessWidget {
HeaderRow({this.dashboardViewModel}); HeaderRow({this.dashboardViewModel});
final DashboardViewModel dashboardViewModel; final DashboardViewModel dashboardViewModel;
final filterIcon = Image.asset('assets/images/filter_icon.png',
color: PaletteDark.wildBlue);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final filterIcon = Image.asset('assets/images/filter_icon.png',
color: Theme.of(context).textTheme.caption.decorationColor);
return Container( return Container(
height: 52, height: 52,
color: Colors.transparent, color: Colors.transparent,
@ -32,154 +29,23 @@ class HeaderRow extends StatelessWidget {
color: Colors.white color: Colors.white
), ),
), ),
PopupMenuButton<int>( GestureDetector(
itemBuilder: (context) => [ onTap: () {
PopupMenuItem( showDialog<void>(
enabled: false, context: context,
value: -1, builder: (context) => FilterWidget(dashboardViewModel: dashboardViewModel)
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),
)
])))
],
child: Container( child: Container(
height: 36, height: 36,
width: 36, width: 36,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: PaletteDark.oceanBlue color: Theme.of(context).textTheme.overline.color
), ),
child: filterIcon, 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);
}
}
},
),
], ],
), ),
); );

View file

@ -1,8 +1,10 @@
import 'dart:ui'; import 'dart:ui';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:flutter/material.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/domain/common/wallet_type.dart';
import 'package:cake_wallet/src/screens/dashboard/wallet_menu.dart'; import 'package:cake_wallet/src/screens/dashboard/wallet_menu.dart';
import 'package:flutter/rendering.dart';
// FIXME: terrible design. // FIXME: terrible design.
@ -16,14 +18,13 @@ class MenuWidget extends StatefulWidget {
} }
class MenuWidgetState extends State<MenuWidget> { class MenuWidgetState extends State<MenuWidget> {
final moneroIcon = Image.asset('assets/images/monero.png'); Image moneroIcon;
final bitcoinIcon = Image.asset('assets/images/bitcoin.png'); Image bitcoinIcon;
final largeScreen = 731; final largeScreen = 731;
double menuWidth; double menuWidth;
double screenWidth; double screenWidth;
double screenHeight; double screenHeight;
double opacity;
double headerHeight; double headerHeight;
double tileHeight; double tileHeight;
@ -35,9 +36,8 @@ class MenuWidgetState extends State<MenuWidget> {
menuWidth = 0; menuWidth = 0;
screenWidth = 0; screenWidth = 0;
screenHeight = 0; screenHeight = 0;
opacity = 0;
headerHeight = 120; headerHeight = 137;
tileHeight = 75; tileHeight = 75;
fromTopEdge = 50; fromTopEdge = 50;
fromBottomEdge = 30; fromBottomEdge = 30;
@ -52,7 +52,6 @@ class MenuWidgetState extends State<MenuWidget> {
setState(() { setState(() {
menuWidth = screenWidth; menuWidth = screenWidth;
opacity = 1;
if (screenHeight > largeScreen) { if (screenHeight > largeScreen) {
final scale = screenHeight / largeScreen; final scale = screenHeight / largeScreen;
@ -70,6 +69,11 @@ class MenuWidgetState extends State<MenuWidget> {
WalletMenu(context, () async => widget.dashboardViewModel.reconnect()); WalletMenu(context, () async => widget.dashboardViewModel.reconnect());
final itemCount = walletMenu.items.length; 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( return Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -81,175 +85,142 @@ class MenuWidgetState extends State<MenuWidget> {
width: 4, width: 4,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(2)), borderRadius: BorderRadius.all(Radius.circular(2)),
color: Theme.of(context).hintColor), color: PaletteDark.gray),
)), )),
SizedBox(width: 12), SizedBox(width: 12),
Expanded( Expanded(
child: GestureDetector( child: ClipRRect(
onTap: () => null,
child: Container(
width: menuWidth,
height: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(24), topLeft: Radius.circular(24),
bottomLeft: Radius.circular(24)), bottomLeft: Radius.circular(24)),
color: Theme.of(context).primaryTextTheme.display1.color), child: Container(
child: ClipRRect( color: Theme.of(context).textTheme.body2.decorationColor,
borderRadius: BorderRadius.only( child: ListView.separated(
topLeft: Radius.circular(24), padding: EdgeInsets.only(top: 0),
bottomLeft: Radius.circular(24)), itemBuilder: (_, index) {
child: ListView.separated( if (index == 0) {
itemBuilder: (_, index) { return Container(
if (index == 0) { height: headerHeight,
return Container( decoration: BoxDecoration(
height: headerHeight, gradient: LinearGradient(
padding: EdgeInsets.only( colors: [
left: 24, Theme.of(context)
top: fromTopEdge, .accentTextTheme
right: 24, .display1
bottom: fromBottomEdge), .color,
decoration: BoxDecoration( Theme.of(context)
borderRadius: .accentTextTheme
BorderRadius.only(topLeft: Radius.circular(24)), .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) color: Theme.of(context)
.primaryTextTheme .primaryTextTheme
.display2 .caption
.color), .decorationColor,
child: Row( ),
mainAxisAlignment: MainAxisAlignment.start, itemCount: itemCount + 1),
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),
),
),
))
], ],
); );
} }

View file

@ -13,35 +13,36 @@ class SyncIndicator extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Observer( return Observer(
builder: (_) { builder: (_) {
final syncIndicatorWidth = 250.0; final syncIndicatorWidth = 237.0;
final status = dashboardViewModel.status; final status = dashboardViewModel.status;
final statusText = status.title(); final statusText = status != null ? status.title() : '';
final progress = status.progress(); final progress = status != null ? status.progress() : 0.0;
final indicatorOffset = progress * syncIndicatorWidth; final indicatorOffset = progress * syncIndicatorWidth;
final indicatorWidth = final indicatorWidth = progress < 1
progress <= 1 ? syncIndicatorWidth - indicatorOffset : 0.0; ? indicatorOffset > 0 ? indicatorOffset : 0.0
: syncIndicatorWidth;
final indicatorColor = status is SyncedSyncStatus final indicatorColor = status is SyncedSyncStatus
? PaletteDark.brightGreen ? PaletteDark.brightGreen
: PaletteDark.orangeYellow; : Theme.of(context).textTheme.caption.color;
return ClipRRect( return ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(15)), borderRadius: BorderRadius.all(Radius.circular(15)),
child: Container( child: Container(
height: 30, height: 30,
width: syncIndicatorWidth, width: syncIndicatorWidth,
color: PaletteDark.lightNightBlue, color: Theme.of(context).textTheme.title.decorationColor,
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: <Widget>[ children: <Widget>[
progress <= 1 progress <= 1
? Positioned( ? Positioned(
left: indicatorOffset, left: 0,
top: 0, top: 0,
bottom: 0, bottom: 0,
child: Container( child: Container(
width: indicatorWidth, width: indicatorWidth,
height: 30, height: 30,
color: PaletteDark.oceanBlue, color: Theme.of(context).textTheme.title.backgroundColor,
) )
) )
: Offstage(), : Offstage(),
@ -70,7 +71,7 @@ class SyncIndicator extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: PaletteDark.wildBlue color: Theme.of(context).textTheme.title.color
), ),
), ),
) )

View file

@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/src/domain/common/crypto_currency.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/domain/exchange/exchange_provider_description.dart';
import 'package:cake_wallet/palette.dart';
class TradeRow extends StatelessWidget { class TradeRow extends StatelessWidget {
TradeRow({ TradeRow({
@ -66,7 +65,8 @@ class TradeRow extends StatelessWidget {
Text(createdAtFormattedDate, Text(createdAtFormattedDate,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: PaletteDark.darkCyanBlue)) color: Theme.of(context).textTheme
.overline.backgroundColor))
]), ]),
], ],
), ),

View file

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; 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/src/domain/common/transaction_direction.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
@ -35,7 +34,7 @@ class TransactionRow extends StatelessWidget {
width: 36, width: 36,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: PaletteDark.wildNightBlue color: Theme.of(context).textTheme.overline.decorationColor
), ),
child: Image.asset( child: Image.asset(
direction == TransactionDirection.incoming direction == TransactionDirection.incoming
@ -79,13 +78,15 @@ class TransactionRow extends StatelessWidget {
Text(formattedDate, Text(formattedDate,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: PaletteDark.darkCyanBlue)), color: Theme.of(context).textTheme
.overline.backgroundColor)),
Text(direction == TransactionDirection.incoming Text(direction == TransactionDirection.incoming
? formattedFiatAmount ? formattedFiatAmount
: '- ' + formattedFiatAmount, : '- ' + formattedFiatAmount,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: PaletteDark.darkCyanBlue)) color: Theme.of(context).textTheme
.overline.backgroundColor))
]), ]),
], ],
), ),

View file

@ -75,7 +75,7 @@ class TransactionsPage extends StatelessWidget {
} }
return Container( return Container(
color: Theme.of(context).backgroundColor, color: Colors.transparent,
height: 1); height: 1);
} }
) )
@ -84,7 +84,8 @@ class TransactionsPage extends StatelessWidget {
S.of(context).placeholder_transactions, S.of(context).placeholder_transactions,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Colors.grey color: Theme.of(context).primaryTextTheme
.overline.decorationColor
), ),
), ),
); );

View file

@ -1,66 +1,59 @@
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/stores/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/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/present_provider_picker.dart';
import 'package:cake_wallet/src/screens/exchange/widgets/base_exchange_widget.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/src/widgets/trail_button.dart';
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
class ExchangePage extends BasePage { class ExchangePage extends BasePage {
ExchangePage(this.exchangeViewModel);
final ExchangeViewModel exchangeViewModel;
@override @override
String get title => S.current.exchange; String get title => S.current.exchange;
@override @override
Color get backgroundLightColor => Palette.darkLavender; Color get titleColor => Colors.white;
@override @override
Color get backgroundDarkColor => PaletteDark.moderateBlue; Color get backgroundLightColor => Colors.transparent;
@override @override
Widget middle(BuildContext context) { Color get backgroundDarkColor => Colors.transparent;
final exchangeStore = Provider.of<ExchangeStore>(context);
return PresentProviderPicker(exchangeStore: exchangeStore);
}
@override @override
Widget trailing(BuildContext context) { Widget middle(BuildContext context) =>
final exchangeStore = Provider.of<ExchangeStore>(context); PresentProviderPicker(exchangeViewModel: exchangeViewModel);
return TrailButton(
caption: S.of(context).reset,
onPressed: () => exchangeStore.reset()
);
}
@override @override
Widget body(BuildContext context) => ExchangeForm(); Widget trailing(BuildContext context) =>
} TrailButton(
caption: S.of(context).reset,
onPressed: () => exchangeViewModel.reset()
);
class ExchangeForm extends StatefulWidget {
@override @override
State<StatefulWidget> createState() => ExchangeFormState(); Widget body(BuildContext context) =>
} BaseExchangeWidget(
exchangeViewModel: exchangeViewModel,
class ExchangeFormState extends State<ExchangeForm> { leading: leading(context),
middle: middle(context),
trailing: trailing(context),
);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final exchangeStore = Provider.of<ExchangeStore>(context); return Scaffold(
final walletStore = Provider.of<WalletStore>(context); resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
final exchangeTemplateStore = Provider.of<ExchangeTemplateStore>(context); body: Container(
color: Theme.of(context).backgroundColor,
return BaseExchangeWidget( child: body(context)
exchangeStore: exchangeStore, )
walletStore: walletStore,
exchangeTemplateStore: exchangeTemplateStore,
isTemplate: false
); );
} }
} }

View file

@ -1,55 +1,51 @@
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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/base_page.dart';
import 'package:cake_wallet/src/screens/exchange/widgets/present_provider_picker.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/src/screens/exchange/widgets/base_exchange_widget.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
class ExchangeTemplatePage extends BasePage { class ExchangeTemplatePage extends BasePage {
ExchangeTemplatePage(this.exchangeViewModel);
final ExchangeViewModel exchangeViewModel;
@override @override
String get title => S.current.exchange_new_template; String get title => S.current.exchange_new_template;
@override @override
Color get backgroundLightColor => Palette.darkLavender; Color get titleColor => Colors.white;
@override @override
Color get backgroundDarkColor => PaletteDark.moderateBlue; Color get backgroundLightColor => Colors.transparent;
@override @override
Widget trailing(BuildContext context) { Color get backgroundDarkColor => Colors.transparent;
final exchangeStore = Provider.of<ExchangeStore>(context);
return PresentProviderPicker(exchangeStore: exchangeStore);
}
@override @override
Widget body(BuildContext context) => ExchangeTemplateForm(); Widget trailing(BuildContext context) =>
} PresentProviderPicker(exchangeViewModel: exchangeViewModel);
class ExchangeTemplateForm extends StatefulWidget{
@override @override
ExchangeTemplateFormState createState() => ExchangeTemplateFormState(); Widget body(BuildContext context) =>
} BaseExchangeWidget(
exchangeViewModel: exchangeViewModel,
class ExchangeTemplateFormState extends State<ExchangeTemplateForm> { leading: leading(context),
middle: middle(context),
trailing: trailing(context),
isTemplate: true
);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final exchangeStore = Provider.of<ExchangeStore>(context); return Scaffold(
final walletStore = Provider.of<WalletStore>(context); resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
final exchangeTemplateStore = Provider.of<ExchangeTemplateStore>(context); body: Container(
color: Theme.of(context).backgroundColor,
return BaseExchangeWidget( child: body(context)
exchangeStore: exchangeStore, )
walletStore: walletStore,
exchangeTemplateStore: exchangeTemplateStore,
isTemplate: true
); );
} }
} }

View file

@ -1,5 +1,7 @@
import 'dart:ui'; import 'dart:ui';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/domain/exchange/exchange_template.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:cake_wallet/src/widgets/template_tile.dart';
import 'package:dotted_border/dotted_border.dart'; import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/cupertino.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/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/exchange_trade_state.dart';
import 'package:cake_wallet/src/stores/exchange/limits_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/screens/exchange/widgets/exchange_card.dart';
import 'package:cake_wallet/src/widgets/primary_button.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/scollable_with_bottom_section.dart';
import 'package:cake_wallet/src/widgets/top_panel.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/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 { class BaseExchangeWidget extends StatefulWidget {
BaseExchangeWidget({ BaseExchangeWidget({
@ required this.exchangeStore, @required this.exchangeViewModel,
@ required this.walletStore, this.leading,
@ required this.exchangeTemplateStore, this.middle,
@ required this.isTemplate, this.trailing,
this.isTemplate = false,
}); });
final ExchangeStore exchangeStore; final ExchangeViewModel exchangeViewModel;
final WalletStore walletStore; final Widget leading;
final ExchangeTemplateStore exchangeTemplateStore; final Widget middle;
final Widget trailing;
final bool isTemplate; final bool isTemplate;
@override @override
BaseExchangeWidgetState createState() => BaseExchangeWidgetState createState() => BaseExchangeWidgetState(
BaseExchangeWidgetState( exchangeViewModel: exchangeViewModel,
exchangeStore: exchangeStore, leading: leading,
walletStore: walletStore, middle: middle,
exchangeTemplateStore: exchangeTemplateStore, trailing: trailing,
isTemplate: isTemplate isTemplate: isTemplate);
);
} }
class BaseExchangeWidgetState extends State<BaseExchangeWidget> { class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
BaseExchangeWidgetState({ BaseExchangeWidgetState({
@ required this.exchangeStore, @required this.exchangeViewModel,
@ required this.walletStore, @required this.leading,
@ required this.exchangeTemplateStore, @required this.middle,
@ required this.isTemplate, @required this.trailing,
@required this.isTemplate,
}); });
final ExchangeStore exchangeStore; final ExchangeViewModel exchangeViewModel;
final WalletStore walletStore; final Widget leading;
final ExchangeTemplateStore exchangeTemplateStore; final Widget middle;
final Widget trailing;
final bool isTemplate; final bool isTemplate;
final double topPanelHeight = 290;
final depositKey = GlobalKey<ExchangeCardState>(); final depositKey = GlobalKey<ExchangeCardState>();
final receiveKey = GlobalKey<ExchangeCardState>(); final receiveKey = GlobalKey<ExchangeCardState>();
@ -64,281 +70,368 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Image arrowBottomPurple = Image.asset( final arrowBottomPurple = Image.asset(
'assets/images/arrow_bottom_purple_icon.png', 'assets/images/arrow_bottom_purple_icon.png',
color: Theme.of(context).primaryTextTheme.title.color, color: Colors.white,
height: 8, height: 8,
); );
final Image arrowBottomCakeGreen = Image.asset( final arrowBottomCakeGreen = Image.asset(
'assets/images/arrow_bottom_cake_green.png', 'assets/images/arrow_bottom_cake_green.png',
color: Theme.of(context).primaryTextTheme.title.color, color: Colors.white,
height: 8, height: 8,
); );
final depositWalletName = final depositWalletName =
exchangeStore.depositCurrency == CryptoCurrency.xmr exchangeViewModel.depositCurrency == CryptoCurrency.xmr
? walletStore.name ? exchangeViewModel.wallet.name
: null; : null;
final receiveWalletName = final receiveWalletName =
exchangeStore.receiveCurrency == CryptoCurrency.xmr exchangeViewModel.receiveCurrency == CryptoCurrency.xmr
? walletStore.name ? exchangeViewModel.wallet.name
: null; : null;
WidgetsBinding.instance.addPostFrameCallback( WidgetsBinding.instance
(_) => _setReactions(context, exchangeStore, walletStore)); .addPostFrameCallback((_) => _setReactions(context, exchangeViewModel));
return Container( return Form(
color: Theme.of(context).backgroundColor, key: _formKey,
child: Form( child: ScrollableWithBottomSection(
key: _formKey, contentPadding: EdgeInsets.only(bottom: 24),
child: ScrollableWithBottomSection( content: Column(
contentPadding: EdgeInsets.only(bottom: 24), children: <Widget>[
content: Column( TopPanel(
children: <Widget>[ gradient: LinearGradient(colors: [
TopPanel( Theme.of(context).primaryTextTheme.body1.color,
color: Theme.of(context).accentTextTheme.title.backgroundColor, Theme.of(context).primaryTextTheme.body1.decorationColor,
edgeInsets: EdgeInsets.only(bottom: 24), ], stops: [
widget: Column( 0.35,
children: <Widget>[ 1.0
TopPanel( ], begin: Alignment.topLeft, end: Alignment.bottomRight),
color: Theme.of(context).accentTextTheme.title.color, edgeInsets: EdgeInsets.only(bottom: 32),
widget: Observer( widget: Column(
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,
children: <Widget>[ children: <Widget>[
Text( TopPanel(
S.of(context).send_templates, edgeInsets: EdgeInsets.all(0),
style: TextStyle( gradient: LinearGradient(
fontSize: 18, colors: [
fontWeight: FontWeight.w600, Theme.of(context)
color: Theme.of(context).primaryTextTheme.caption.color .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
isTemplate ? Offstage()
? Offstage() : Padding(
: Container( padding: EdgeInsets.only(top: 30, left: 24, bottom: 24),
height: 40, child: Row(
width: double.infinity, mainAxisAlignment: MainAxisAlignment.start,
padding: EdgeInsets.only(left: 24), children: <Widget>[
child: Observer( Text(
builder: (_) { S.of(context).send_templates,
final itemCount = exchangeTemplateStore.templates.length + 1; style: TextStyle(
fontSize: 18,
return ListView.builder( fontWeight: FontWeight.w600,
scrollDirection: Axis.horizontal, color: Theme.of(context)
itemCount: itemCount, .primaryTextTheme
itemBuilder: (context, index) { .display4
.color),
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 isTemplate
? PrimaryButton( ? Offstage()
onPressed: () { : Container(
if (_formKey.currentState.validate()) { height: 40,
exchangeTemplateStore.addTemplate( width: double.infinity,
amount: exchangeStore.depositAmount, padding: EdgeInsets.only(left: 24),
depositCurrency: exchangeStore.depositCurrency.toString(), child: SingleChildScrollView(
receiveCurrency: exchangeStore.receiveCurrency.toString(), scrollDirection: Axis.horizontal,
provider: exchangeStore.provider.toString(), child: Row(
depositAddress: exchangeStore.depositAddress, children: <Widget>[
receiveAddress: exchangeStore.receiveAddress GestureDetector(
); onTap: () => Navigator.of(context)
exchangeTemplateStore.update(); .pushNamed(Routes.exchangeTemplate),
Navigator.of(context).pop(); child: Container(
} padding: EdgeInsets.only(left: 1, right: 10),
}, child: DottedBorder(
text: S.of(context).save, borderType: BorderType.RRect,
color: Colors.green, dashPattern: [6, 4],
textColor: Colors.white color: Theme.of(context)
) .primaryTextTheme
: Observer( .display2
builder: (_) => LoadingPrimaryButton( .decorationColor,
text: S.of(context).exchange, 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: () { onPressed: () {
if (_formKey.currentState.validate()) { 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, text: S.of(context).save,
textColor: Colors.white, color: Colors.green,
isLoading: exchangeStore.tradeState is TradeIsCreating, 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) { void applyTemplate(
store.changeDepositCurrency(currency: CryptoCurrency.fromString(template.depositCurrency)); ExchangeViewModel exchangeViewModel, ExchangeTemplate template) {
store.changeReceiveCurrency(currency: CryptoCurrency.fromString(template.receiveCurrency)); exchangeViewModel.changeDepositCurrency(
currency: CryptoCurrency.fromString(template.depositCurrency));
exchangeViewModel.changeReceiveCurrency(
currency: CryptoCurrency.fromString(template.receiveCurrency));
switch (template.provider) { switch (template.provider) {
case 'XMR.TO': case 'XMR.TO':
store.changeProvider(provider: store.providerList[0]); exchangeViewModel.changeProvider(
provider: exchangeViewModel.providerList[0]);
break; break;
case 'ChangeNOW': case 'ChangeNOW':
store.changeProvider(provider: store.providerList[1]); exchangeViewModel.changeProvider(
provider: exchangeViewModel.providerList[1]);
break; break;
case 'MorphToken': case 'MorphToken':
store.changeProvider(provider: store.providerList[2]); exchangeViewModel.changeProvider(
provider: exchangeViewModel.providerList[2]);
break; break;
} }
store.changeDepositAmount(amount: template.amount); exchangeViewModel.changeDepositAmount(amount: template.amount);
store.depositAddress = template.depositAddress; exchangeViewModel.depositAddress = template.depositAddress;
store.receiveAddress = template.receiveAddress; exchangeViewModel.receiveAddress = template.receiveAddress;
} }
void _setReactions( void _setReactions(
BuildContext context, ExchangeStore store, WalletStore walletStore) { BuildContext context, ExchangeViewModel exchangeViewModel) {
if (_isReactionsSet) { if (_isReactionsSet) {
return; return;
} }
@ -347,7 +440,7 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
final depositAmountController = depositKey.currentState.amountController; final depositAmountController = depositKey.currentState.amountController;
final receiveAddressController = receiveKey.currentState.addressController; final receiveAddressController = receiveKey.currentState.addressController;
final receiveAmountController = receiveKey.currentState.amountController; final receiveAmountController = receiveKey.currentState.amountController;
final limitsState = store.limitsState; final limitsState = exchangeViewModel.limitsState;
if (limitsState is LimitsLoadedSuccessfully) { if (limitsState is LimitsLoadedSuccessfully) {
final min = limitsState.limits.min != null final min = limitsState.limits.min != null
@ -360,63 +453,66 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
key.currentState.changeLimits(min: min, max: max); key.currentState.changeLimits(min: min, max: max);
} }
_onCurrencyChange(store.receiveCurrency, walletStore, receiveKey); _onCurrencyChange(
_onCurrencyChange(store.depositCurrency, walletStore, depositKey); exchangeViewModel.receiveCurrency, exchangeViewModel, receiveKey);
_onCurrencyChange(
exchangeViewModel.depositCurrency, exchangeViewModel, depositKey);
reaction( reaction(
(_) => walletStore.name, (_) => exchangeViewModel.wallet.name,
(String _) => _onWalletNameChange( (String _) => _onWalletNameChange(
walletStore, store.receiveCurrency, receiveKey)); exchangeViewModel, exchangeViewModel.receiveCurrency, receiveKey));
reaction( reaction(
(_) => walletStore.name, (_) => exchangeViewModel.wallet.name,
(String _) => _onWalletNameChange( (String _) => _onWalletNameChange(
walletStore, store.depositCurrency, depositKey)); exchangeViewModel, exchangeViewModel.depositCurrency, depositKey));
reaction( reaction(
(_) => store.receiveCurrency, (_) => exchangeViewModel.receiveCurrency,
(CryptoCurrency currency) => (CryptoCurrency currency) =>
_onCurrencyChange(currency, walletStore, receiveKey)); _onCurrencyChange(currency, exchangeViewModel, receiveKey));
reaction( reaction(
(_) => store.depositCurrency, (_) => exchangeViewModel.depositCurrency,
(CryptoCurrency currency) => (CryptoCurrency currency) =>
_onCurrencyChange(currency, walletStore, depositKey)); _onCurrencyChange(currency, exchangeViewModel, depositKey));
reaction((_) => store.depositAmount, (String amount) { reaction((_) => exchangeViewModel.depositAmount, (String amount) {
if (depositKey.currentState.amountController.text != amount) { if (depositKey.currentState.amountController.text != amount) {
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) { if (depositKey.currentState.addressController.text != address) {
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); depositKey.currentState.isAddressEditable(isEditable: isEnabled);
}); });
reaction((_) => store.receiveAmount, (String amount) { reaction((_) => exchangeViewModel.receiveAmount, (String amount) {
if (receiveKey.currentState.amountController.text != if (receiveKey.currentState.amountController.text != amount) {
store.receiveAmount) {
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) { if (receiveKey.currentState.addressController.text != address) {
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); receiveKey.currentState.isAddressEditable(isEditable: isEnabled);
}); });
reaction((_) => store.tradeState, (ExchangeTradeState state) { reaction((_) => exchangeViewModel.tradeState, (ExchangeTradeState state) {
if (state is TradeIsCreatedFailure) { if (state is TradeIsCreatedFailure) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<void>( showDialog<void>(
@ -426,18 +522,16 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
alertTitle: S.of(context).error, alertTitle: S.of(context).error,
alertContent: state.error, alertContent: state.error,
buttonText: S.of(context).ok, buttonText: S.of(context).ok,
buttonAction: () => Navigator.of(context).pop() buttonAction: () => Navigator.of(context).pop());
);
}); });
}); });
} }
if (state is TradeIsCreatedSuccessfully) { if (state is TradeIsCreatedSuccessfully) {
Navigator.of(context) Navigator.of(context).pushNamed(Routes.exchangeConfirm);
.pushNamed(Routes.exchangeConfirm, arguments: state.trade);
} }
}); });
reaction((_) => store.limitsState, (LimitsState state) { reaction((_) => exchangeViewModel.limitsState, (LimitsState state) {
String min; String min;
String max; String max;
@ -461,29 +555,31 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
}); });
depositAddressController.addListener( depositAddressController.addListener(
() => store.depositAddress = depositAddressController.text); () => exchangeViewModel.depositAddress = depositAddressController.text);
depositAmountController.addListener(() { depositAmountController.addListener(() {
if (depositAmountController.text != store.depositAmount) { if (depositAmountController.text != exchangeViewModel.depositAmount) {
store.changeDepositAmount(amount: depositAmountController.text); exchangeViewModel.changeDepositAmount(
amount: depositAmountController.text);
} }
}); });
receiveAddressController.addListener( receiveAddressController.addListener(
() => store.receiveAddress = receiveAddressController.text); () => exchangeViewModel.receiveAddress = receiveAddressController.text);
receiveAmountController.addListener(() { receiveAmountController.addListener(() {
if (receiveAmountController.text != store.receiveAmount) { if (receiveAmountController.text != exchangeViewModel.receiveAmount) {
store.changeReceiveAmount(amount: receiveAmountController.text); exchangeViewModel.changeReceiveAmount(
amount: receiveAmountController.text);
} }
}); });
reaction((_) => walletStore.address, (String address) { reaction((_) => exchangeViewModel.wallet.address, (String address) {
if (store.depositCurrency == CryptoCurrency.xmr) { if (exchangeViewModel.depositCurrency == CryptoCurrency.xmr) {
depositKey.currentState.changeAddress(address: address); depositKey.currentState.changeAddress(address: address);
} }
if (store.receiveCurrency == CryptoCurrency.xmr) { if (exchangeViewModel.receiveCurrency == CryptoCurrency.xmr) {
receiveKey.currentState.changeAddress(address: address); receiveKey.currentState.changeAddress(address: address);
} }
}); });
@ -491,30 +587,32 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
_isReactionsSet = true; _isReactionsSet = true;
} }
void _onCurrencyChange(CryptoCurrency currency, WalletStore walletStore, void _onCurrencyChange(CryptoCurrency currency,
GlobalKey<ExchangeCardState> key) { ExchangeViewModel exchangeViewModel, GlobalKey<ExchangeCardState> key) {
final isCurrentTypeWallet = currency == walletStore.type; final isCurrentTypeWallet = currency == exchangeViewModel.wallet.currency;
key.currentState.changeSelectedCurrency(currency); key.currentState.changeSelectedCurrency(currency);
key.currentState key.currentState.changeWalletName(
.changeWalletName(isCurrentTypeWallet ? walletStore.name : null); isCurrentTypeWallet ? exchangeViewModel.wallet.name : null);
key.currentState key.currentState.changeAddress(
.changeAddress(address: isCurrentTypeWallet ? walletStore.address : ''); address: isCurrentTypeWallet ? exchangeViewModel.wallet.address : '');
key.currentState.changeAmount(amount: ''); key.currentState.changeAmount(amount: '');
} }
void _onWalletNameChange(WalletStore walletStore, CryptoCurrency currency, void _onWalletNameChange(ExchangeViewModel exchangeViewModel,
GlobalKey<ExchangeCardState> key) { CryptoCurrency currency, GlobalKey<ExchangeCardState> key) {
final isCurrentTypeWallet = currency == walletStore.type; final isCurrentTypeWallet = currency == exchangeViewModel.wallet.currency;
if (isCurrentTypeWallet) { if (isCurrentTypeWallet) {
key.currentState.changeWalletName(walletStore.name); key.currentState.changeWalletName(exchangeViewModel.wallet.name);
key.currentState.addressController.text = walletStore.address; key.currentState.addressController.text =
} else if (key.currentState.addressController.text == walletStore.address) { exchangeViewModel.wallet.address;
} else if (key.currentState.addressController.text ==
exchangeViewModel.wallet.address) {
key.currentState.changeWalletName(null); key.currentState.changeWalletName(null);
key.currentState.addressController.text = null; key.currentState.addressController.text = null;
} }
} }
} }

View file

@ -1,8 +1,10 @@
import 'dart:ui'; import 'dart:ui';
import 'package:cake_wallet/palette.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/domain/common/crypto_currency.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 { class CurrencyPicker extends StatelessWidget {
CurrencyPicker({ CurrencyPicker({
@ -16,104 +18,103 @@ class CurrencyPicker extends StatelessWidget {
final List<CryptoCurrency> items; final List<CryptoCurrency> items;
final String title; final String title;
final Function(CryptoCurrency) onItemSelected; final Function(CryptoCurrency) onItemSelected;
final closeButton = Image.asset('assets/images/close.png',
color: Palette.darkBlueCraiola,
);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return AlertBackground(
onTap: () => Navigator.of(context).pop(), child: Stack(
child: Container( alignment: Alignment.center,
color: Colors.transparent, children: <Widget>[
child: BackdropFilter( Column(
filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), mainAxisSize: MainAxisSize.min,
child: Container( children: <Widget>[
decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), Container(
child: Center( padding: EdgeInsets.only(left: 24, right: 24),
child: Column( child: Text(
mainAxisSize: MainAxisSize.min, title,
children: <Widget>[ textAlign: TextAlign.center,
Container( style: TextStyle(
padding: EdgeInsets.only(left: 24, right: 24), fontSize: 18,
child: Text( fontFamily: 'Poppins',
title, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, decoration: TextDecoration.none,
style: TextStyle( color: Colors.white
fontSize: 18,
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Colors.white
),
), ),
), ),
Padding( ),
padding: EdgeInsets.only(top: 24), Padding(
child: GestureDetector( padding: EdgeInsets.only(top: 24),
onTap: () => null, child: GestureDetector(
child: ClipRRect( onTap: () => null,
borderRadius: BorderRadius.all(Radius.circular(14)), child: ClipRRect(
child: Container( borderRadius: BorderRadius.all(Radius.circular(14)),
height: 400, child: Container(
width: 300, height: 400,
color: Theme.of(context).dividerColor, width: 300,
child: GridView.count( color: Theme.of(context).accentTextTheme.title.backgroundColor,
shrinkWrap: true, child: GridView.count(
crossAxisCount: 3, shrinkWrap: true,
childAspectRatio: 1.25, crossAxisCount: 3,
physics: const NeverScrollableScrollPhysics(), childAspectRatio: 1.25,
crossAxisSpacing: 1, physics: const NeverScrollableScrollPhysics(),
mainAxisSpacing: 1, crossAxisSpacing: 1,
children: List.generate(15, (index) { mainAxisSpacing: 1,
children: List.generate(15, (index) {
if (index == 14) { if (index == 14) {
return Container( return Container(
color: Theme.of(context).primaryTextTheme.display1.color, color: Theme.of(context).accentTextTheme.title.color,
); );
} }
final item = items[index]; final item = items[index];
final isItemSelected = index == selectedAtIndex; final isItemSelected = index == selectedAtIndex;
final color = isItemSelected final color = isItemSelected
? Theme.of(context).accentTextTheme.subtitle.decorationColor ? Theme.of(context).textTheme.body2.color
: Theme.of(context).primaryTextTheme.display1.color; : Theme.of(context).accentTextTheme.title.color;
final textColor = isItemSelected final textColor = isItemSelected
? Colors.blue ? Palette.blueCraiola
: Theme.of(context).primaryTextTheme.title.color; : Theme.of(context).primaryTextTheme.title.color;
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
if (onItemSelected == null) { if (onItemSelected == null) {
return; return;
} }
Navigator.of(context).pop(); Navigator.of(context).pop();
onItemSelected(item); onItemSelected(item);
}, },
child: Container( child: Container(
color: color, color: color,
child: Center( child: Center(
child: Text( child: Text(
item.toString(), item.toString(),
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontFamily: 'Poppins',
decoration: TextDecoration.none, fontWeight: FontWeight.w600,
color: textColor decoration: TextDecoration.none,
), color: textColor
), ),
), ),
), ),
); ),
}) );
), })
), ),
), ),
), ),
) ),
], )
), ],
) ),
), AlertCloseButton(image: closeButton)
), ],
), )
); );
} }
} }

View file

@ -21,6 +21,7 @@ class ExchangeCard extends StatefulWidget {
this.imageArrow, this.imageArrow,
this.currencyButtonColor = Colors.transparent, this.currencyButtonColor = Colors.transparent,
this.addressButtonsColor = Colors.transparent, this.addressButtonsColor = Colors.transparent,
this.borderColor = Colors.transparent,
this.currencyValueValidator, this.currencyValueValidator,
this.addressTextFieldValidator}) this.addressTextFieldValidator})
: super(key: key); : super(key: key);
@ -37,6 +38,7 @@ class ExchangeCard extends StatefulWidget {
final Image imageArrow; final Image imageArrow;
final Color currencyButtonColor; final Color currencyButtonColor;
final Color addressButtonsColor; final Color addressButtonsColor;
final Color borderColor;
final FormFieldValidator<String> currencyValueValidator; final FormFieldValidator<String> currencyValueValidator;
final FormFieldValidator<String> addressTextFieldValidator; final FormFieldValidator<String> addressTextFieldValidator;
@ -110,10 +112,15 @@ class ExchangeCardState extends State<ExchangeCard> {
@override @override
Widget build(BuildContext context) { 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( return Container(
width: double.infinity, width: double.infinity,
color: Colors.transparent, color: Colors.transparent,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -123,13 +130,13 @@ class ExchangeCardState extends State<ExchangeCard> {
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Theme.of(context).primaryTextTheme.caption.color color: Theme.of(context).textTheme.headline.color
), ),
) )
], ],
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 20),
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
BaseTextFormField( BaseTextFormField(
@ -139,11 +146,25 @@ class ExchangeCardState extends State<ExchangeCard> {
keyboardType: TextInputType.numberWithOptions( keyboardType: TextInputType.numberWithOptions(
signed: false, decimal: true), signed: false, decimal: true),
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(15),
BlacklistingTextInputFormatter( BlacklistingTextInputFormatter(
RegExp('[\\-|\\ |\\,]')) RegExp('[\\-|\\ |\\,]'))
], ],
hintText: '0.0000', 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( Positioned(
top: 8, top: 8,
@ -163,7 +184,7 @@ class ExchangeCardState extends State<ExchangeCard> {
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 16, fontSize: 16,
color: Theme.of(context).primaryTextTheme.title.color)), color: Colors.white)),
Padding( Padding(
padding: EdgeInsets.only(left: 5), padding: EdgeInsets.only(left: 5),
child: widget.imageArrow, child: widget.imageArrow,
@ -181,45 +202,102 @@ class ExchangeCardState extends State<ExchangeCard> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
_min != null _min != null
? Text( ? Text(
S.of(context).min_value( S.of(context).min_value(
_min, _selectedCurrency.toString()), _min, _selectedCurrency.toString()),
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: 10,
height: 1.2, 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(), _min != null ? SizedBox(width: 10) : Offstage(),
_max != null _max != null
? Text( ? Text(
S.of(context).max_value( S.of(context).max_value(
_max, _selectedCurrency.toString()), _max, _selectedCurrency.toString()),
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: 10,
height: 1.2, height: 1.2,
color: Theme.of(context).primaryTextTheme.caption.color)) color: Theme.of(context).textTheme.subhead.decorationColor))
: Offstage(), : Offstage(),
]), ]),
), ),
Padding( _isAddressEditable
padding: EdgeInsets.only(top: 10), ? 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( child: AddressTextField(
controller: addressController, controller: addressController,
isActive: _isAddressEditable, options: [
options: _isAddressEditable AddressTextFieldOption.paste,
? _walletName != null
? []
: [
AddressTextFieldOption.qrCode, AddressTextFieldOption.qrCode,
AddressTextFieldOption.addressBook, AddressTextFieldOption.addressBook,
] ],
: [],
isBorderExist: false, 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, buttonColor: widget.addressButtonsColor,
validator: widget.addressTextFieldValidator, 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,
)
],
),
)
),
),
]), ]),
); );
} }

View file

@ -1,21 +1,21 @@
import 'package:flutter/material.dart'; 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_description.dart';
import 'package:cake_wallet/src/domain/exchange/exchange_provider.dart'; import 'package:cake_wallet/src/domain/exchange/exchange_provider.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/picker.dart'; import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
class PresentProviderPicker extends StatelessWidget { class PresentProviderPicker extends StatelessWidget {
PresentProviderPicker({@required this.exchangeStore}); PresentProviderPicker({@required this.exchangeViewModel});
final ExchangeStore exchangeStore; final ExchangeViewModel exchangeViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Image arrowBottom = final arrowBottom =
Image.asset('assets/images/arrow_bottom_purple_icon.png', Image.asset('assets/images/arrow_bottom_purple_icon.png',
color: Theme.of(context).primaryTextTheme.title.color, color: Colors.white,
height: 6); height: 6);
return FlatButton( return FlatButton(
@ -33,19 +33,19 @@ class PresentProviderPicker extends StatelessWidget {
Text(S.of(context).exchange, Text(S.of(context).exchange,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w600,
color: Theme.of(context).primaryTextTheme.title.color)), color: Colors.white)),
Observer( Observer(
builder: (_) => Text('${exchangeStore.provider.title}', builder: (_) => Text('${exchangeViewModel.provider.title}',
style: TextStyle( style: TextStyle(
fontSize: 10.0, fontSize: 10.0,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w500,
color: Theme.of(context).primaryTextTheme.caption.color))) color: Theme.of(context).textTheme.headline.color)))
], ],
), ),
SizedBox(width: 5), SizedBox(width: 5),
Padding( Padding(
padding: EdgeInsets.only(top: 8), padding: EdgeInsets.only(top: 12),
child: arrowBottom, child: arrowBottom,
) )
], ],
@ -54,11 +54,11 @@ class PresentProviderPicker extends StatelessWidget {
} }
void _presentProviderPicker(BuildContext context) { void _presentProviderPicker(BuildContext context) {
final items = exchangeStore.providersForCurrentPair(); final items = exchangeViewModel.providersForCurrentPair();
final selectedItem = items.indexOf(exchangeStore.provider); final selectedItem = items.indexOf(exchangeViewModel.provider);
final images = List<Image>(); final images = <Image>[];
for (ExchangeProvider provider in items) { for (var provider in items) {
switch (provider.description) { switch (provider.description) {
case ExchangeProviderDescription.xmrto: case ExchangeProviderDescription.xmrto:
images.add(Image.asset('assets/images/xmr_btc.png')); images.add(Image.asset('assets/images/xmr_btc.png'));
@ -79,7 +79,7 @@ class PresentProviderPicker extends StatelessWidget {
selectedAtIndex: selectedItem, selectedAtIndex: selectedItem,
title: S.of(context).change_exchange_provider, title: S.of(context).change_exchange_provider,
onItemSelected: (ExchangeProvider provider) => onItemSelected: (ExchangeProvider provider) =>
exchangeStore.changeProvider(provider: provider)), exchangeViewModel.changeProvider(provider: provider)),
context: context); context: context);
} }
} }

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/store/dashboard/trades_store.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/services.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/widgets/primary_button.dart';
import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/domain/exchange/trade.dart'; import 'package:cake_wallet/src/domain/exchange/trade.dart';
import 'package:cake_wallet/palette.dart';
class ExchangeConfirmPage extends BasePage { class ExchangeConfirmPage extends BasePage {
ExchangeConfirmPage({@required this.trade}); ExchangeConfirmPage({@required this.tradesStore}) : trade = tradesStore.trade;
final TradesStore tradesStore;
final Trade trade; final Trade trade;
@override @override
@ -17,93 +20,102 @@ class ExchangeConfirmPage extends BasePage {
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
final copyImage = Image.asset('assets/images/copy_content.png',
color: Theme.of(context).primaryTextTheme.title.color);
return Container( return Container(
padding: EdgeInsets.all(24), padding: EdgeInsets.fromLTRB(24, 0, 24, 24),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Center( child: Column(
child: Column( children: <Widget>[
mainAxisSize: MainAxisSize.min, Flexible(
children: <Widget>[ child: Center(
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: Text( child: Text(
S.of(context).trade_id, S.of(context).exchange_result_write_down_trade_id,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 18.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
color: Theme.of(context).primaryTextTheme.title.color), 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( child: Column(
padding: EdgeInsets.only(top: 24), children: <Widget>[
child: Builder( Expanded(
builder: (context) => GestureDetector( child: Padding(
onTap: () { padding: EdgeInsets.all(24),
Clipboard.setData(ClipboardData(text: trade.id)); child: Column(
Scaffold.of(context).showSnackBar(SnackBar( mainAxisAlignment: MainAxisAlignment.spaceBetween,
content: Text( crossAxisAlignment: CrossAxisAlignment.center,
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,
children: <Widget>[ children: <Widget>[
Expanded( Text(
child: Text( S.of(context).trade_id,
trade.id, style: TextStyle(
maxLines: 1, fontSize: 12.0,
overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w500,
style: TextStyle( color: Theme.of(context).primaryTextTheme.overline.color
fontSize: 18, ),
fontWeight: FontWeight.w600, ),
color: Theme.of(context).primaryTextTheme.title.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( PrimaryButton(
onPressed: () => Navigator.of(context) onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.exchangeTrade, arguments: trade), .pushReplacementNamed(Routes.exchangeTrade),
text: S.of(context).saved_the_trade_id, text: S.of(context).saved_the_trade_id,
color: Colors.green, color: Palette.blueCraiola,
textColor: Colors.white) textColor: Colors.white)
], ],
), ),

View 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;
}

View file

@ -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/common/crypto_currency.dart';
import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.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:mobx/mobx.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_mobx/flutter_mobx.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_one_action.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.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 { class ExchangeTradePage extends BasePage {
ExchangeTradePage({@required this.exchangeTradeViewModel});
final ExchangeTradeViewModel exchangeTradeViewModel;
@override @override
String get title => S.current.exchange; String get title => S.current.exchange;
@override @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 { class ExchangeTradeForm extends StatefulWidget {
ExchangeTradeForm(this.exchangeTradeViewModel);
final ExchangeTradeViewModel exchangeTradeViewModel;
@override @override
ExchangeTradeState createState() => ExchangeTradeState(); ExchangeTradeState createState() => ExchangeTradeState();
} }
@ -39,263 +91,139 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
bool _effectsInstalled = false; bool _effectsInstalled = false;
@override @override
Widget build(BuildContext context) { void initState() {
final tradeStore = Provider.of<ExchangeTradeStore>(context); super.initState();
final sendStore = Provider.of<SendStore>(context); WidgetsBinding.instance.addPostFrameCallback(afterLayout);
final walletStore = Provider.of<WalletStore>(context); }
_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( return Container(
child: ScrollableWithBottomSection( child: ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(left: 24, right: 24, top: 24), contentPadding: EdgeInsets.only(top: 10, bottom: 16),
content: Observer(builder: (_) { content: Observer(builder: (_) {
final trade = tradeStore.trade; final trade = widget.exchangeTradeViewModel.trade;
final walletName = walletStore.name;
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( trade.expiredAt != null
child: Row( ? Row(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max,
children: [ mainAxisAlignment: MainAxisAlignment.center,
Column( children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: <Widget>[ S.of(context).offer_expires_in,
Row( style: TextStyle(
mainAxisAlignment: MainAxisAlignment.start, fontSize: 14.0,
children: <Widget>[ fontWeight: FontWeight.w500,
Text( color: Theme.of(context).primaryTextTheme.overline.color),
S.of(context).id, ),
style: TextStyle( TimerWidget(trade.expiredAt,
height: 2, color: Theme.of(context).primaryTextTheme.title.color)
fontWeight: FontWeight.bold, ])
fontSize: 14.0, : Offstage(),
color: Theme.of(context).primaryTextTheme.title.color), Padding(
), padding: EdgeInsets.only(top: 32),
Text( child: Row(children: <Widget>[
'${trade.id ?? fetchingLabel}', Spacer(flex: 3),
style: TextStyle( Flexible(
fontSize: 14.0, flex: 4,
height: 2, child: Center(
color: Theme.of(context).primaryTextTheme.caption.color), child: AspectRatio(
) aspectRatio: 1.0,
], child: QrImage(
), data: trade.inputAddress ?? fetchingLabel,
Row( backgroundColor: Colors.transparent,
mainAxisAlignment: MainAxisAlignment.start, foregroundColor: Theme.of(context)
children: <Widget>[ .accentTextTheme.subtitle.color,
Text( )))),
S.of(context).amount, Spacer(flex: 3)
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(),
],
),
],
),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 20), padding: EdgeInsets.only(top: 16),
child: Row( child: ListView.separated(
children: <Widget>[ shrinkWrap: true,
Spacer( physics: NeverScrollableScrollPhysics(),
flex: 1, itemCount: widget.exchangeTradeViewModel.items.length,
), separatorBuilder: (context, index) => Container(
Flexible( height: 1,
flex: 1, color: Theme.of(context).accentTextTheme.subtitle.backgroundColor,
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),
), ),
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), bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24),
bottomSection: Observer( bottomSection: PrimaryButton(
onPressed: () {},
text: S.of(context).confirm,
color: Palette.blueCraiola,
textColor: Colors.white
)
/*Observer(
builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr && builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr &&
!(sendStore.state is TransactionCommitted) !(sendStore.state is TransactionCommitted)
? LoadingPrimaryButton( ? LoadingPrimaryButton(
@ -312,7 +240,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
: S.of(context).send_xmr, : S.of(context).send_xmr,
color: Colors.blue, color: Colors.blue,
textColor: Colors.white) textColor: Colors.white)
: Offstage()), : Offstage()),*/
), ),
); );
} }
@ -322,7 +250,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
return; return;
} }
final sendStore = Provider.of<SendStore>(context); /*final sendStore = Provider.of<SendStore>(context);
reaction((_) => sendStore.state, (SendingState state) { reaction((_) => sendStore.state, (SendingState state) {
if (state is SendingFailed) { if (state is SendingFailed) {
@ -376,7 +304,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
}); });
}); });
} }
}); });*/
_effectsInstalled = true; _effectsInstalled = true;
} }

View 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
),
)
],
),
),
)
);
}
}

View file

@ -53,10 +53,16 @@ class TimerWidgetState extends State<TimerWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return _isExpired return _isExpired
? Text(S.of(context).expired, ? 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( : Text(
S.of(context).time(_minutes.toString(), _seconds.toString()), 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),
); );
} }

View file

@ -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/widgets/primary_button.dart';
import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
import 'package:cake_wallet/palette.dart';
class MoneroAccountEditOrCreatePage extends BasePage { class MoneroAccountEditOrCreatePage extends BasePage {
MoneroAccountEditOrCreatePage({@required this.moneroAccountCreationViewModel}) MoneroAccountEditOrCreatePage({@required this.moneroAccountCreationViewModel})
@ -24,12 +23,6 @@ class MoneroAccountEditOrCreatePage extends BasePage {
@override @override
String get title => S.current.account; String get title => S.current.account;
@override
Color get backgroundLightColor => PaletteDark.backgroundColor;
@override
Color get backgroundDarkColor => PaletteDark.backgroundColor;
final GlobalKey<FormState> _formKey; final GlobalKey<FormState> _formKey;
final TextEditingController _textController; final TextEditingController _textController;
@ -45,7 +38,6 @@ class MoneroAccountEditOrCreatePage extends BasePage {
child: Center( child: Center(
child: BaseTextFormField( child: BaseTextFormField(
controller: _textController, controller: _textController,
textColor: Colors.white,
hintText: S.of(context).account, hintText: S.of(context).account,
validator: MoneroLabelValidator(), validator: MoneroLabelValidator(),
))), ))),

View file

@ -27,7 +27,9 @@ class MoneroAccountListPage extends StatelessWidget {
} }
final MoneroAccountListViewModel accountListViewModel; final MoneroAccountListViewModel accountListViewModel;
final closeIcon = Image.asset('assets/images/close.png'); final closeIcon = Image.asset('assets/images/close.png',
color: Palette.darkBlueCraiola,
);
ScrollController controller; ScrollController controller;
double backgroundHeight; double backgroundHeight;
@ -64,7 +66,7 @@ class MoneroAccountListPage extends StatelessWidget {
borderRadius: BorderRadius.all(Radius.circular(14)), borderRadius: BorderRadius.all(Radius.circular(14)),
child: Container( child: Container(
height: 296, height: 296,
color: PaletteDark.deepPurpleBlue, color: Theme.of(context).textTheme.display4.decorationColor,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -83,7 +85,7 @@ class MoneroAccountListPage extends StatelessWidget {
separatorBuilder: (context, index) => separatorBuilder: (context, index) =>
Container( Container(
height: 1, height: 1,
color: PaletteDark.dividerColor, color: Theme.of(context).dividerColor,
), ),
itemCount: accounts.length ?? 0, itemCount: accounts.length ?? 0,
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -121,7 +123,7 @@ class MoneroAccountListPage extends StatelessWidget {
.pushNamed(Routes.accountCreation), .pushNamed(Routes.accountCreation),
child: Container( child: Container(
height: 62, height: 62,
color: Colors.white, color: Theme.of(context).textTheme.subtitle.decorationColor,
padding: EdgeInsets.only(left: 24, right: 24), padding: EdgeInsets.only(left: 24, right: 24),
child: Center( child: Center(
child: Row( child: Row(
@ -129,7 +131,7 @@ class MoneroAccountListPage extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Icon( Icon(
Icons.add, Icons.add,
color: PaletteDark.darkNightBlue, color: Colors.white,
), ),
Padding( Padding(
padding: EdgeInsets.only(left: 5), padding: EdgeInsets.only(left: 5),
@ -138,7 +140,7 @@ class MoneroAccountListPage extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: PaletteDark.darkNightBlue, color: Colors.white,
decoration: TextDecoration.none, decoration: TextDecoration.none,
), ),
), ),

View file

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
class AccountTile extends StatelessWidget { class AccountTile extends StatelessWidget {
AccountTile({ AccountTile({
@ -14,8 +13,12 @@ class AccountTile extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final color = isCurrent ? PaletteDark.lightOceanBlue : Colors.transparent; final color = isCurrent
final textColor = isCurrent ? Colors.blue : Colors.white; ? 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( return GestureDetector(
onTap: onTap, onTap: onTap,

View file

@ -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_item.dart';
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.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/src/screens/receive/widgets/qr_widget.dart';
import 'package:cake_wallet/palette.dart';
class ReceivePage extends BasePage { class ReceivePage extends BasePage {
ReceivePage({this.addressListViewModel}); ReceivePage({this.addressListViewModel});
@ -25,10 +24,26 @@ class ReceivePage extends BasePage {
String get title => S.current.receive; String get title => S.current.receive;
@override @override
Color get backgroundLightColor => PaletteDark.backgroundColor; Color get backgroundLightColor => Colors.transparent;
@override @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 @override
Widget trailing(BuildContext context) { Widget trailing(BuildContext context) {
@ -66,7 +81,9 @@ class ReceivePage extends BasePage {
Observer( Observer(
builder: (_) => ListView.separated( builder: (_) => ListView.separated(
separatorBuilder: (context, _) => separatorBuilder: (context, _) =>
Container(height: 1, color: PaletteDark.dividerColor), Container(
height: 1,
color: Theme.of(context).dividerColor),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: addressListViewModel.items.length, itemCount: addressListViewModel.items.length,
@ -83,7 +100,7 @@ class ReceivePage extends BasePage {
icon: Icon( icon: Icon(
Icons.arrow_forward_ios, Icons.arrow_forward_ios,
size: 14, size: 14,
color: Colors.white, color: Theme.of(context).textTheme.display1.color,
)); ));
} }
@ -95,7 +112,7 @@ class ReceivePage extends BasePage {
icon: Icon( icon: Icon(
Icons.add, Icons.add,
size: 20, size: 20,
color: Colors.white, color: Theme.of(context).textTheme.display1.color,
)); ));
} }
@ -105,11 +122,11 @@ class ReceivePage extends BasePage {
final isCurrent = item.address == final isCurrent = item.address ==
addressListViewModel.address.address; addressListViewModel.address.address;
final backgroundColor = isCurrent final backgroundColor = isCurrent
? PaletteDark.lightOceanBlue ? Theme.of(context).textTheme.display3.decorationColor
: PaletteDark.nightBlue; : Theme.of(context).textTheme.display2.decorationColor;
final textColor = isCurrent final textColor = isCurrent
? Colors.blue ? Theme.of(context).textTheme.display3.color
: Colors.white; : Theme.of(context).textTheme.display2.color;
return AddressCell.fromItem(item, return AddressCell.fromItem(item,
isCurrent: isCurrent, isCurrent: isCurrent,

View file

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
class HeaderTile extends StatelessWidget { class HeaderTile extends StatelessWidget {
HeaderTile({ HeaderTile({
@ -23,7 +22,7 @@ class HeaderTile extends StatelessWidget {
top: 24, top: 24,
bottom: 24 bottom: 24
), ),
color: PaletteDark.nightBlue, color: Theme.of(context).textTheme.display2.decorationColor,
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -32,8 +31,8 @@ class HeaderTile extends StatelessWidget {
title, title,
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w600,
color: Colors.white color: Theme.of(context).textTheme.display2.color
), ),
), ),
Container( Container(
@ -41,7 +40,7 @@ class HeaderTile extends StatelessWidget {
width: 32, width: 32,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: PaletteDark.distantNightBlue color: Theme.of(context).textTheme.display1.decorationColor
), ),
child: icon, child: icon,
) )

View file

@ -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/src/widgets/base_text_form_field.dart';
import 'package:cake_wallet/core/amount_validator.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/view_model/wallet_address_list/wallet_address_list_view_model.dart';
import 'package:cake_wallet/palette.dart';
class QRWidget extends StatelessWidget { class QRWidget extends StatelessWidget {
QRWidget({ QRWidget({
@ -27,7 +26,7 @@ class QRWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final copyImage = Image.asset('assets/images/copy_address.png', 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; final addressTopOffset = isAmountFieldShow ? 60.0 : 40.0;
return Column( return Column(
@ -45,7 +44,7 @@ class QRWidget extends StatelessWidget {
child: QrImage( child: QrImage(
data: addressListViewModel.uri.toString(), data: addressListViewModel.uri.toString(),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
foregroundColor: PaletteDark.lightBlueGrey, foregroundColor: Theme.of(context).textTheme.headline.color,
))))), ))))),
Spacer(flex: 3) Spacer(flex: 3)
]), ]),
@ -56,7 +55,7 @@ class QRWidget extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: PaletteDark.cyanBlue color: Theme.of(context).indicatorColor
), ),
), ),
), ),
@ -79,13 +78,14 @@ class QRWidget extends StatelessWidget {
textAlign: TextAlign.center, textAlign: TextAlign.center,
hintText: S.of(context).receive_amount, hintText: S.of(context).receive_amount,
textColor: Colors.white, textColor: Colors.white,
borderColor: PaletteDark.darkGrey, borderColor: Theme.of(context).textTheme.headline.decorationColor,
validator: AmountValidator( validator: AmountValidator(
type: addressListViewModel.type type: addressListViewModel.type,
isAutovalidate: true
), ),
autovalidate: true, autovalidate: true,
placeholderTextStyle: TextStyle( placeholderTextStyle: TextStyle(
color: PaletteDark.cyanBlue, color: Theme.of(context).hoverColor,
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500)))) fontWeight: FontWeight.w500))))
], ],

File diff suppressed because it is too large Load diff

View file

@ -1,277 +1,47 @@
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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/src/screens/base_page.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/top_panel.dart'; import 'package:cake_wallet/view_model/send_view_model.dart';
import 'package:cake_wallet/src/stores/send_template/send_template_store.dart'; import 'package:cake_wallet/src/screens/send/widgets/base_send_widget.dart';
class SendTemplatePage extends BasePage { class SendTemplatePage extends BasePage {
@override SendTemplatePage({@required this.sendViewModel});
String get title => S.current.send_title;
final SendViewModel sendViewModel;
@override @override
Color get backgroundLightColor => Palette.lavender; String get title => S.current.exchange_new_template;
@override @override
Color get backgroundDarkColor => PaletteDark.lightNightBlue; Color get titleColor => Colors.white;
@override
Color get backgroundLightColor => Colors.transparent;
@override
Color get backgroundDarkColor => Colors.transparent;
@override @override
bool get resizeToAvoidBottomPadding => false; bool get resizeToAvoidBottomPadding => false;
@override @override
Widget body(BuildContext context) => SendTemplateForm(); Widget body(BuildContext context) =>
} BaseSendWidget(
sendViewModel: sendViewModel,
class SendTemplateForm extends StatefulWidget { leading: leading(context),
@override middle: middle(context),
SendTemplateFormState createState() => SendTemplateFormState(); isTemplate: true
} );
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();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final settingsStore = Provider.of<SettingsStore>(context); return Scaffold(
final balanceStore = Provider.of<BalanceStore>(context); resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
final sendStore = Provider.of<SendStore>(context); body: Container(
sendStore.settingsStore = settingsStore; color: Theme.of(context).backgroundColor,
final sendTemplateStore = Provider.of<SendTemplateStore>(context); child: body(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
),
),
); );
} }
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;
}
} }

View 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()
);
});
}
}
}

View file

@ -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/primary_button.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.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/src/screens/base_page.dart';
import 'package:cake_wallet/palette.dart';
class AddressEditOrCreatePage extends BasePage { class AddressEditOrCreatePage extends BasePage {
AddressEditOrCreatePage({@required this.addressEditOrCreateViewModel}) AddressEditOrCreatePage({@required this.addressEditOrCreateViewModel})
@ -29,12 +28,6 @@ class AddressEditOrCreatePage extends BasePage {
@override @override
String get title => S.current.new_subaddress_title; String get title => S.current.new_subaddress_title;
@override
Color get backgroundLightColor => PaletteDark.backgroundColor;
@override
Color get backgroundDarkColor => PaletteDark.backgroundColor;
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
reaction((_) => addressEditOrCreateViewModel.state, reaction((_) => addressEditOrCreateViewModel.state,
@ -55,7 +48,6 @@ class AddressEditOrCreatePage extends BasePage {
child: Center( child: Center(
child: BaseTextFormField( child: BaseTextFormField(
controller: _labelController, controller: _labelController,
textColor: Colors.white,
hintText: S.of(context).new_subaddress_label_name, hintText: S.of(context).new_subaddress_label_name,
validator: AddressLabelValidator()))), validator: AddressLabelValidator()))),
Observer( Observer(

View file

@ -24,7 +24,6 @@ class TradeDetailsPage extends BasePage {
formatDefault: "dd.MM.yyyy, HH:mm"); formatDefault: "dd.MM.yyyy, HH:mm");
return Container( return Container(
padding: EdgeInsets.only(top: 20, bottom: 20),
child: Observer(builder: (_) { child: Observer(builder: (_) {
final trade = exchangeStore.trade; final trade = exchangeStore.trade;
final items = [ final items = [
@ -59,17 +58,15 @@ class TradeDetailsPage extends BasePage {
separatorBuilder: (_, __) => Container( separatorBuilder: (_, __) => Container(
height: 1, height: 1,
padding: EdgeInsets.only(left: 24), padding: EdgeInsets.only(left: 24),
color: Theme.of(context).accentTextTheme.title.backgroundColor, color: Theme.of(context).backgroundColor,
child: Container( child: Container(
height: 1, height: 1,
color: Theme.of(context).dividerColor, color: Theme.of(context).primaryTextTheme.title.backgroundColor,
), ),
), ),
itemCount: items.length, itemCount: items.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
final item = items[index]; final item = items[index];
final isDrawTop = index == 0 ? true : false;
final isDrawBottom = index == items.length - 1 ? true : false; final isDrawBottom = index == items.length - 1 ? true : false;
return GestureDetector( return GestureDetector(
@ -87,7 +84,6 @@ class TradeDetailsPage extends BasePage {
child: StandartListRow( child: StandartListRow(
title: '${item.title}', title: '${item.title}',
value: '${item.value}', value: '${item.value}',
isDrawTop: isDrawTop,
isDrawBottom: isDrawBottom, isDrawBottom: isDrawBottom,
)); ));
}); });

View file

@ -73,22 +73,19 @@ class TransactionDetailsPage extends BasePage {
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.only(top: 20, bottom: 20),
child: ListView.separated( child: ListView.separated(
separatorBuilder: (context, index) => Container( separatorBuilder: (context, index) => Container(
height: 1, height: 1,
padding: EdgeInsets.only(left: 24), padding: EdgeInsets.only(left: 24),
color: Theme.of(context).accentTextTheme.title.backgroundColor, color: Theme.of(context).backgroundColor,
child: Container( child: Container(
height: 1, height: 1,
color: Theme.of(context).dividerColor, color: Theme.of(context).primaryTextTheme.title.backgroundColor,
), ),
), ),
itemCount: _items.length, itemCount: _items.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = _items[index]; final item = _items[index];
final isDrawTop = index == 0 ? true : false;
final isDrawBottom = index == _items.length - 1 ? true : false; final isDrawBottom = index == _items.length - 1 ? true : false;
return GestureDetector( return GestureDetector(
@ -106,7 +103,6 @@ class TransactionDetailsPage extends BasePage {
child: StandartListRow( child: StandartListRow(
title: '${item.title}:', title: '${item.title}:',
value: item.value, value: item.value,
isDrawTop: isDrawTop,
isDrawBottom: isDrawBottom), isDrawBottom: isDrawBottom),
); );
}), }),

View file

@ -37,11 +37,14 @@ class WalletListBodyState extends State<WalletListBody> {
final bitcoinIcon = final bitcoinIcon =
Image.asset('assets/images/bitcoin.png', height: 24, width: 24); Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
final scrollController = ScrollController(); final scrollController = ScrollController();
final double tileHeight = 60;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final newWalletImage = Image.asset('assets/images/new_wallet.png', 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', final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
height: 12, height: 12,
width: 12, width: 12,
@ -58,7 +61,7 @@ class WalletListBodyState extends State<WalletListBody> {
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
separatorBuilder: (_, index) => Divider( separatorBuilder: (_, index) => Divider(
color: Theme.of(context).backgroundColor, height: 16), color: Theme.of(context).backgroundColor, height: 32),
itemCount: widget.walletListViewModel.wallets.length, itemCount: widget.walletListViewModel.wallets.length,
itemBuilder: (__, index) { itemBuilder: (__, index) {
final wallet = widget.walletListViewModel.wallets[index]; final wallet = widget.walletListViewModel.wallets[index];
@ -72,7 +75,7 @@ class WalletListBodyState extends State<WalletListBody> {
.generateImagesForWalletMenu(wallet.isCurrent); .generateImagesForWalletMenu(wallet.isCurrent);
return Container( return Container(
height: 108, height: tileHeight,
width: double.infinity, width: double.infinity,
child: CustomScrollView( child: CustomScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
@ -82,7 +85,7 @@ class WalletListBodyState extends State<WalletListBody> {
pinned: false, pinned: false,
floating: true, floating: true,
delegate: WalletTile( delegate: WalletTile(
min: screenWidth - 228, min: screenWidth - 170,
max: screenWidth, max: screenWidth,
image: _imageFor(type: wallet.type), image: _imageFor(type: wallet.type),
walletName: wallet.name, walletName: wallet.name,
@ -93,10 +96,11 @@ class WalletListBodyState extends State<WalletListBody> {
delegate: delegate:
SliverChildBuilderDelegate((context, index) { SliverChildBuilderDelegate((context, index) {
final item = items[index]; final item = items[index];
final color = colors[index];
final image = images[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( return GestureDetector(
onTap: () { onTap: () {
@ -109,8 +113,8 @@ class WalletListBodyState extends State<WalletListBody> {
wallet.isCurrent); wallet.isCurrent);
}, },
child: Container( child: Container(
height: 108, height: tileHeight,
width: 108, width: 80,
color: Theme.of(context).backgroundColor, color: Theme.of(context).backgroundColor,
child: Container( child: Container(
padding: EdgeInsets.only(left: 5, right: 5), padding: EdgeInsets.only(left: 5, right: 5),
@ -118,18 +122,27 @@ class WalletListBodyState extends State<WalletListBody> {
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(radius), topLeft: Radius.circular(radius),
bottomLeft: Radius.circular(radius)), bottomLeft: Radius.circular(radius)),
color: color), gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
firstColor,
secondColor
]
)
),
child: Center( child: Center(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
image, image,
SizedBox(height: 5), SizedBox(height: 2),
Text( Text(
item, item,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 7,
fontWeight: FontWeight.w500,
color: Colors.white), color: Colors.white),
) )
], ],
@ -151,9 +164,8 @@ class WalletListBodyState extends State<WalletListBody> {
Navigator.of(context).pushNamed(Routes.newWalletType), Navigator.of(context).pushNamed(Routes.newWalletType),
image: newWalletImage, image: newWalletImage,
text: S.of(context).wallet_list_create_new_wallet, text: S.of(context).wallet_list_create_new_wallet,
color: Colors.white, color: Theme.of(context).accentTextTheme.subtitle.decorationColor,
textColor: Palette.oceanBlue, textColor: Theme.of(context).accentTextTheme.headline.decorationColor,
borderColor: Palette.oceanBlue,
), ),
SizedBox(height: 10.0), SizedBox(height: 10.0),
PrimaryImageButton( PrimaryImageButton(
@ -161,7 +173,7 @@ class WalletListBodyState extends State<WalletListBody> {
.pushNamed(Routes.restoreWalletType), .pushNamed(Routes.restoreWalletType),
image: restoreWalletImage, image: restoreWalletImage,
text: S.of(context).wallet_list_restore_wallet, 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) textColor: Theme.of(context).primaryTextTheme.title.color)
])), ])),
)); ));

View file

@ -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/src/stores/wallet_list/wallet_list_store.dart';
import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.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/src/screens/auth/auth_page.dart';
import 'package:cake_wallet/palette.dart';
class WalletMenu { class WalletMenu {
WalletMenu(this.context, this.walletListViewModel); WalletMenu(this.context, this.walletListViewModel);
@ -20,18 +21,25 @@ class WalletMenu {
S.current.rescan S.current.rescan
]; ];
final List<Color> listColors = [ final List<Color> firstColors = [
Colors.blue, Palette.cornflower,
Colors.orange, Palette.moderateOrangeYellow,
Colors.red, Palette.lightRed,
Colors.green Palette.shineGreen
];
final List<Color> secondColors = [
Palette.royalBlue,
Palette.moderateOrange,
Palette.persianRed,
Palette.moderateGreen
]; ];
final List<Image> listImages = [ final List<Image> listImages = [
Image.asset('assets/images/load.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: 32, width: 32, color: Colors.white), Image.asset('assets/images/eye_action.png', height: 24, width: 24, color: Colors.white),
Image.asset('assets/images/trash.png', height: 32, width: 32, color: Colors.white), Image.asset('assets/images/trash.png', height: 24, width: 24, color: Colors.white),
Image.asset('assets/images/scanner.png', height: 32, width: 32, color: Colors.white) Image.asset('assets/images/scanner.png', height: 24, width: 24, color: Colors.white)
]; ];
List<String> generateItemsForWalletMenu(bool isCurrentWallet) { List<String> generateItemsForWalletMenu(bool isCurrentWallet) {
@ -46,18 +54,30 @@ class WalletMenu {
} }
List<Color> generateColorsForWalletMenu(bool isCurrentWallet) { List<Color> generateColorsForWalletMenu(bool isCurrentWallet) {
final colors = List<Color>(); final colors = <Color>[];
if (!isCurrentWallet) colors.add(listColors[0]); if (!isCurrentWallet) {
if (isCurrentWallet) colors.add(listColors[1]); colors.add(firstColors[0]);
if (!isCurrentWallet) colors.add(listColors[2]); colors.add(secondColors[0]);
if (isCurrentWallet) colors.add(listColors[3]); }
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; return colors;
} }
List<Image> generateImagesForWalletMenu(bool isCurrentWallet) { List<Image> generateImagesForWalletMenu(bool isCurrentWallet) {
final images = List<Image>(); final images = <Image>[];
if (!isCurrentWallet) images.add(listImages[0]); if (!isCurrentWallet) images.add(listImages[0]);
if (isCurrentWallet) images.add(listImages[1]); if (isCurrentWallet) images.add(listImages[1]);

View file

@ -17,17 +17,18 @@ class WalletTile extends SliverPersistentHeaderDelegate {
final String walletName; final String walletName;
final String walletAddress; final String walletAddress;
final bool isCurrent; final bool isCurrent;
final double tileHeight = 60;
@override @override
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) { Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
var opacity = 1 - shrinkOffset / (max - min); var opacity = 1 - shrinkOffset / (max - min);
opacity = opacity >= 0 ? opacity : 0; opacity = opacity >= 0 ? opacity : 0;
var panelWidth = 12 * opacity; var panelWidth = 10 * opacity;
panelWidth = panelWidth < 12 ? 0 : 12; panelWidth = panelWidth < 10 ? 0 : 10;
final currentColor = isCurrent final currentColor = isCurrent
? Theme.of(context).accentTextTheme.caption.color ? Theme.of(context).accentTextTheme.subtitle.decorationColor
: Theme.of(context).backgroundColor; : Theme.of(context).backgroundColor;
return Stack( return Stack(
@ -38,7 +39,7 @@ class WalletTile extends SliverPersistentHeaderDelegate {
top: 0, top: 0,
right: max - 4, right: max - 4,
child: Container( child: Container(
height: 108, height: tileHeight,
width: 4, width: 4,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only(topRight: Radius.circular(4), bottomRight: Radius.circular(4)), borderRadius: BorderRadius.only(topRight: Radius.circular(4), bottomRight: Radius.circular(4)),
@ -48,13 +49,30 @@ class WalletTile extends SliverPersistentHeaderDelegate {
), ),
Positioned( Positioned(
top: 0, top: 0,
right: 12, right: 10,
child: Container( child: Container(
height: 108, height: tileHeight,
width: max - 16, width: max - 14,
padding: EdgeInsets.only(left: 20, right: 20), padding: EdgeInsets.only(left: 20, right: 20),
color: Theme.of(context).backgroundColor, 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, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
@ -92,7 +110,7 @@ class WalletTile extends SliverPersistentHeaderDelegate {
) )
: Offstage() : Offstage()
], ],
), ),*/
), ),
), ),
Positioned( Positioned(
@ -101,29 +119,18 @@ class WalletTile extends SliverPersistentHeaderDelegate {
child: Opacity( child: Opacity(
opacity: opacity, opacity: opacity,
child: Container( child: Container(
height: 108, height: tileHeight,
width: panelWidth, width: panelWidth,
padding: EdgeInsets.only(
top: 1,
left: 1,
bottom: 1
),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), bottomLeft: Radius.circular(12)), borderRadius: BorderRadius.only(topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)),
color: Theme.of(context).accentTextTheme.subtitle.color gradient: LinearGradient(
), begin: Alignment.topCenter,
child: Container( end: Alignment.bottomCenter,
decoration: BoxDecoration( colors: [
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), bottomLeft: Radius.circular(12)), Theme.of(context).accentTextTheme.headline.color,
gradient: LinearGradient( Theme.of(context).accentTextTheme.headline.backgroundColor
begin: Alignment.topCenter, ]
end: Alignment.bottomCenter, )
colors: [
Theme.of(context).accentTextTheme.caption.backgroundColor,
Theme.of(context).accentTextTheme.caption.decorationColor
]
)
),
), ),
), ),
) )

View file

@ -1,26 +1,31 @@
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/domain/common/contact.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/monero/subaddress.dart';
import 'package:cake_wallet/src/domain/common/qr_scanner.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 { class AddressTextField extends StatelessWidget {
AddressTextField( AddressTextField(
{@required this.controller, {@required this.controller,
this.isActive = true, this.isActive = true,
this.placeholder, this.placeholder,
this.options = const [ this.options = const [
AddressTextFieldOption.qrCode, AddressTextFieldOption.qrCode,
AddressTextFieldOption.addressBook AddressTextFieldOption.addressBook
], ],
this.onURIScanned, this.onURIScanned,
this.focusNode, this.focusNode,
this.isBorderExist = true, this.isBorderExist = true,
this.buttonColor, this.buttonColor,
this.validator}); this.borderColor,
this.textStyle,
this.hintStyle,
this.validator});
static const prefixIconWidth = 34.0; static const prefixIconWidth = 34.0;
static const prefixIconHeight = 34.0; static const prefixIconHeight = 34.0;
@ -34,6 +39,9 @@ class AddressTextField extends StatelessWidget {
final FormFieldValidator<String> validator; final FormFieldValidator<String> validator;
final bool isBorderExist; final bool isBorderExist;
final Color buttonColor; final Color buttonColor;
final Color borderColor;
final TextStyle textStyle;
final TextStyle hintStyle;
FocusNode focusNode; FocusNode focusNode;
@override @override
@ -45,106 +53,133 @@ class AddressTextField extends StatelessWidget {
enabled: isActive, enabled: isActive,
controller: controller, controller: controller,
focusNode: focusNode, focusNode: focusNode,
style: TextStyle( style: textStyle ?? TextStyle(
fontSize: 16, fontSize: 16,
color: Theme.of(context).primaryTextTheme.title.color color: Colors.white
), ),
decoration: InputDecoration( decoration: InputDecoration(
suffixIcon: SizedBox( suffixIcon: SizedBox(
width: prefixIconWidth * options.length + width: prefixIconWidth * options.length +
(spaceBetweenPrefixIcons * options.length), (spaceBetweenPrefixIcons * options.length),
), ),
hintStyle: TextStyle( hintStyle: hintStyle ?? TextStyle(
fontSize: 16, fontSize: 16,
color: Theme.of(context).primaryTextTheme.caption.color color: PaletteDark.darkCyanBlue
), ),
hintText: placeholder ?? S.current.widgets_address, hintText: placeholder ?? S.current.widgets_address,
focusedBorder: isBorderExist focusedBorder: isBorderExist
? UnderlineInputBorder( ? UnderlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme.of(context).dividerColor, color: borderColor ?? Theme.of(context).dividerColor,
width: 1.0)) width: 1.0))
: InputBorder.none, : InputBorder.none,
disabledBorder: isBorderExist disabledBorder: isBorderExist
? UnderlineInputBorder( ? UnderlineInputBorder(
borderSide: borderSide:
BorderSide(color: Theme.of(context).dividerColor, width: 1.0)) BorderSide(color: borderColor ?? Theme.of(context).dividerColor, width: 1.0))
: InputBorder.none, : InputBorder.none,
enabledBorder: isBorderExist enabledBorder: isBorderExist
? UnderlineInputBorder( ? UnderlineInputBorder(
borderSide: borderSide:
BorderSide(color: Theme.of(context).dividerColor, width: 1.0)) BorderSide(color: borderColor ?? Theme.of(context).dividerColor, width: 1.0))
: InputBorder.none, : InputBorder.none,
), ),
validator: validator, validator: validator,
), ),
Positioned( Positioned(
bottom: 10, top: 2,
right: 0, right: 0,
child: SizedBox( child: SizedBox(
width: prefixIconWidth * options.length + width: prefixIconWidth * options.length +
(spaceBetweenPrefixIcons * options.length), (spaceBetweenPrefixIcons * options.length),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
SizedBox(width: 5), SizedBox(width: 5),
if (this.options.contains(AddressTextFieldOption.qrCode)) ...[ if (this
Container( .options
width: prefixIconWidth, .contains(AddressTextFieldOption.paste)) ...[
height: prefixIconHeight, Container(
padding: EdgeInsets.only(top: 0), width: prefixIconWidth,
child: InkWell( height: prefixIconHeight,
onTap: () async => _presentQRScanner(context), padding: EdgeInsets.only(top: 0),
child: Container( child: InkWell(
padding: EdgeInsets.all(8), onTap: () async => _pasteAddress(context),
decoration: BoxDecoration( child: Container(
color: buttonColor ?? Theme.of(context).accentTextTheme.title.color, padding: EdgeInsets.all(8),
borderRadius: decoration: BoxDecoration(
BorderRadius.all(Radius.circular(6))), color: buttonColor ?? Theme.of(context).accentTextTheme.title.color,
child: Image.asset('assets/images/qr_code_icon.png')), 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; 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;
}
}
}

View file

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/src/widgets/base_alert_dialog.dart'; import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
import 'package:cake_wallet/palette.dart';
class AlertWithOneAction extends BaseAlertDialog { class AlertWithOneAction extends BaseAlertDialog {
AlertWithOneAction({ AlertWithOneAction({
@ -31,13 +32,7 @@ class AlertWithOneAction extends BaseAlertDialog {
width: 300, width: 300,
height: 52, height: 52,
padding: EdgeInsets.only(left: 12, right: 12), padding: EdgeInsets.only(left: 12, right: 12),
decoration: BoxDecoration( color: Palette.blueCraiola,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24)
),
color: Colors.white
),
child: ButtonTheme( child: ButtonTheme(
minWidth: double.infinity, minWidth: double.infinity,
child: FlatButton( child: FlatButton(
@ -50,7 +45,7 @@ class AlertWithOneAction extends BaseAlertDialog {
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.blue, color: Colors.white,
decoration: TextDecoration.none, decoration: TextDecoration.none,
), ),
)), )),

View file

@ -17,6 +17,7 @@ class BaseAlertDialog extends StatelessWidget {
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Theme.of(context).primaryTextTheme.title.color, color: Theme.of(context).primaryTextTheme.title.color,
decoration: TextDecoration.none, decoration: TextDecoration.none,
@ -30,7 +31,7 @@ class BaseAlertDialog extends StatelessWidget {
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontFamily: 'Poppins',
color: Theme.of(context).primaryTextTheme.title.color, color: Theme.of(context).primaryTextTheme.title.color,
decoration: TextDecoration.none, decoration: TextDecoration.none,
), ),
@ -38,55 +39,39 @@ class BaseAlertDialog extends StatelessWidget {
} }
Widget actionButtons(BuildContext context) { Widget actionButtons(BuildContext context) {
return Container( return Row(
width: 300, mainAxisSize: MainAxisSize.max,
height: 52, children: <Widget>[
decoration: BoxDecoration( Flexible(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24)
),
color: Colors.white
),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Flexible(
child: Container( child: Container(
height: 52,
padding: EdgeInsets.only(left: 12, right: 12), padding: EdgeInsets.only(left: 12, right: 12),
decoration: BoxDecoration( color: Palette.blueCraiola,
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24)),
),
child: ButtonTheme( child: ButtonTheme(
minWidth: double.infinity, minWidth: double.infinity,
child: FlatButton( child: FlatButton(
onPressed: actionLeft, onPressed: actionLeft,
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
splashColor: Colors.transparent, splashColor: Colors.transparent,
child: Text( child: Text(
leftActionButtonText, leftActionButtonText,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w600, fontFamily: 'Poppins',
color: Colors.blue, fontWeight: FontWeight.w600,
decoration: TextDecoration.none, color: Colors.white,
), decoration: TextDecoration.none,
)), ),
)),
), ),
) )
), ),
Container( Flexible(
height: 52,
width: 1,
color: Colors.grey.withOpacity(0.2),
),
Flexible(
child: Container( child: Container(
height: 52,
padding: EdgeInsets.only(left: 12, right: 12), padding: EdgeInsets.only(left: 12, right: 12),
decoration: BoxDecoration( color: Palette.alizarinRed,
borderRadius: BorderRadius.only(bottomRight: Radius.circular(24)),
),
child: ButtonTheme( child: ButtonTheme(
minWidth: double.infinity, minWidth: double.infinity,
child: FlatButton( child: FlatButton(
@ -98,16 +83,16 @@ class BaseAlertDialog extends StatelessWidget {
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.red, color: Colors.white,
decoration: TextDecoration.none, decoration: TextDecoration.none,
), ),
)), )),
), ),
) )
) )
], ],
),
); );
} }
@ -126,44 +111,30 @@ class BaseAlertDialog extends StatelessWidget {
child: Center( child: Center(
child: GestureDetector( child: GestureDetector(
onTap: () => null, onTap: () => null,
child: Container( child: ClipRRect(
width: 300, borderRadius: BorderRadius.all(Radius.circular(30)),
height: 257, child: Container(
decoration: BoxDecoration( width: 300,
borderRadius: BorderRadius.all(Radius.circular(24)), color: Theme.of(context).accentTextTheme.title.decorationColor,
color: Theme.of(context).accentTextTheme.title.backgroundColor child: Column(
), mainAxisSize: MainAxisSize.min,
child: Column( children: <Widget>[
children: <Widget>[ Container(
Container( padding: EdgeInsets.fromLTRB(24, 32, 24, 32),
width: 300, child: Column(
height: 77, crossAxisAlignment: CrossAxisAlignment.center,
padding: EdgeInsets.only(left: 24, right: 24), children: <Widget>[
decoration: BoxDecoration( title(context),
borderRadius: BorderRadius.only( Padding(
topLeft: Radius.circular(24), padding: EdgeInsets.only(top: 8),
topRight: Radius.circular(24) child: content(context),
)
],
), ),
), ),
child: Center( actionButtons(context)
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)
],
), ),
), ),
), ),

View file

@ -15,11 +15,14 @@ class BaseTextFormField extends StatelessWidget {
this.hintColor, this.hintColor,
this.borderColor, this.borderColor,
this.prefix, this.prefix,
this.prefixIcon,
this.suffix, this.suffix,
this.suffixIcon, this.suffixIcon,
this.enabled = true, this.enabled = true,
this.validator, this.validator,
this.placeholderTextStyle}); this.textStyle,
this.placeholderTextStyle,
this.maxLength});
final TextEditingController controller; final TextEditingController controller;
final TextInputType keyboardType; final TextInputType keyboardType;
@ -33,11 +36,14 @@ class BaseTextFormField extends StatelessWidget {
final Color hintColor; final Color hintColor;
final Color borderColor; final Color borderColor;
final Widget prefix; final Widget prefix;
final Widget prefixIcon;
final Widget suffix; final Widget suffix;
final Widget suffixIcon; final Widget suffixIcon;
final bool enabled; final bool enabled;
final FormFieldValidator<String> validator; final FormFieldValidator<String> validator;
final TextStyle placeholderTextStyle; final TextStyle placeholderTextStyle;
final TextStyle textStyle;
final int maxLength;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -50,26 +56,31 @@ class BaseTextFormField extends StatelessWidget {
maxLines: maxLines, maxLines: maxLines,
inputFormatters: inputFormatters, inputFormatters: inputFormatters,
enabled: enabled, enabled: enabled,
style: TextStyle( maxLength: maxLength,
style: textStyle ?? TextStyle(
fontSize: 16.0, fontSize: 16.0,
color: textColor ?? Theme.of(context).primaryTextTheme.title.color), color: textColor ?? Theme.of(context).primaryTextTheme.title.color),
decoration: InputDecoration( decoration: InputDecoration(
prefix: prefix, prefix: prefix,
prefixIcon: prefixIcon,
suffix: suffix, suffix: suffix,
suffixIcon: suffixIcon, suffixIcon: suffixIcon,
hintStyle: placeholderTextStyle ?? hintStyle: placeholderTextStyle ??
TextStyle( TextStyle(
color: hintColor ?? color: hintColor ?? Theme.of(context).hintColor,
Theme.of(context).primaryTextTheme.caption.color,
fontSize: 16), fontSize: 16),
hintText: hintText, hintText: hintText,
focusedBorder: UnderlineInputBorder( focusedBorder: UnderlineInputBorder(
borderSide: BorderSide( 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)), width: 1.0)),
enabledBorder: UnderlineInputBorder( enabledBorder: UnderlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: borderColor ?? Theme.of(context).dividerColor, color: borderColor ?? Theme.of(context).primaryTextTheme.title.backgroundColor,
width: 1.0))), width: 1.0))),
validator: validator, validator: validator,
); );

View file

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
class CakeScrollbar extends StatelessWidget { class CakeScrollbar extends StatelessWidget {
CakeScrollbar({ CakeScrollbar({
@ -20,7 +19,7 @@ class CakeScrollbar extends StatelessWidget {
height: backgroundHeight, height: backgroundHeight,
width: 6, width: 6,
decoration: BoxDecoration( decoration: BoxDecoration(
color: PaletteDark.violetBlue, color: Theme.of(context).textTheme.body1.decorationColor,
borderRadius: BorderRadius.all(Radius.circular(3)) borderRadius: BorderRadius.all(Radius.circular(3))
), ),
child: Stack( child: Stack(
@ -32,7 +31,7 @@ class CakeScrollbar extends StatelessWidget {
height: thumbHeight, height: thumbHeight,
width: 6.0, width: 6.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: PaletteDark.wildBlueGrey, color: Theme.of(context).textTheme.body1.color,
borderRadius: BorderRadius.all(Radius.circular(3)) borderRadius: BorderRadius.all(Radius.circular(3))
), ),
), ),

View 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
),
),
)
],
),
);
}
}

View file

@ -71,6 +71,8 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
EdgeInsetsDirectional.only(bottom: _paddingBottom, top: paddingTop), EdgeInsetsDirectional.only(bottom: _paddingBottom, top: paddingTop),
child: CupertinoNavigationBar( child: CupertinoNavigationBar(
leading: leading, leading: leading,
automaticallyImplyLeading: false,
automaticallyImplyMiddle: false,
middle: middle, middle: middle,
trailing: trailing, trailing: trailing,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,

View file

@ -1,15 +1,20 @@
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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'; import 'package:cake_wallet/palette.dart';
class Picker<Item extends Object> extends StatelessWidget { class Picker<Item extends Object> extends StatefulWidget {
Picker({ Picker({
@required this.selectedAtIndex, @required this.selectedAtIndex,
@required this.items, @required this.items,
this.images, this.images,
@required this.title, @required this.title,
@required this.onItemSelected, @required this.onItemSelected,
this.mainAxisAlignment = MainAxisAlignment.start this.mainAxisAlignment = MainAxisAlignment.start,
this.isAlwaysShowScrollThumb = false
}); });
final int selectedAtIndex; final int selectedAtIndex;
@ -18,59 +23,87 @@ class Picker<Item extends Object> extends StatelessWidget {
final String title; final String title;
final Function(Item) onItemSelected; final Function(Item) onItemSelected;
final MainAxisAlignment mainAxisAlignment; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( controller.addListener(() {
onTap: () => Navigator.of(context).pop(), fromTop = controller.hasClients
child: Container( ? (controller.offset / controller.position.maxScrollExtent * (backgroundHeight - thumbHeight))
color: Colors.transparent, : 0;
child: BackdropFilter( setState(() {});
filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), });
child: Container(
decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), return AlertBackground(
child: Center( child: Stack(
child: Column( alignment: Alignment.center,
mainAxisSize: MainAxisSize.min, children: <Widget>[
children: <Widget>[ Column(
Container( mainAxisSize: MainAxisSize.min,
padding: EdgeInsets.only(left: 24, right: 24), children: <Widget>[
child: Text( Container(
title, padding: EdgeInsets.only(left: 24, right: 24),
textAlign: TextAlign.center, child: Text(
style: TextStyle( widget.title,
fontSize: 18, textAlign: TextAlign.center,
fontWeight: FontWeight.bold, style: TextStyle(
decoration: TextDecoration.none, fontSize: 18,
color: Colors.white fontFamily: 'Poppins',
), fontWeight: FontWeight.bold,
), decoration: TextDecoration.none,
color: Colors.white
), ),
Padding( ),
padding: EdgeInsets.only(left: 24, right: 24, top: 24), ),
child: GestureDetector( Padding(
onTap: () => null, padding: EdgeInsets.only(left: 24, right: 24, top: 24),
child: ClipRRect( child: GestureDetector(
borderRadius: BorderRadius.all(Radius.circular(14)), onTap: () => null,
child: Container( child: ClipRRect(
height: 233, borderRadius: BorderRadius.all(Radius.circular(14)),
color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Container(
child: ListView.separated( height: 233,
color: Theme.of(context).accentTextTheme.title.color,
child: Stack(
alignment: Alignment.center,
children: <Widget>[
ListView.separated(
controller: controller,
separatorBuilder: (context, index) => Divider( separatorBuilder: (context, index) => Divider(
color: Theme.of(context).dividerColor, color: Theme.of(context).accentTextTheme.title.backgroundColor,
height: 1, height: 1,
), ),
itemCount: items == null ? 0 : items.length, itemCount: items == null ? 0 : items.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = items[index]; final item = items[index];
final image = images != null? images[index] : null; final image = images != null? images[index] : null;
final isItemSelected = index == selectedAtIndex; final isItemSelected = index == widget.selectedAtIndex;
final color = isItemSelected final color = isItemSelected
? Theme.of(context).accentTextTheme.subtitle.decorationColor ? Theme.of(context).textTheme.body2.color
: Colors.transparent; : Theme.of(context).accentTextTheme.title.color;
final textColor = isItemSelected final textColor = isItemSelected
? Colors.blue ? Palette.blueCraiola
: Theme.of(context).primaryTextTheme.title.color; : Theme.of(context).primaryTextTheme.title.color;
return GestureDetector( return GestureDetector(
@ -87,21 +120,22 @@ class Picker<Item extends Object> extends StatelessWidget {
color: color, color: color,
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: mainAxisAlignment, mainAxisAlignment: widget.mainAxisAlignment,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
image != null image != null
? image ? image
: Offstage(), : Offstage(),
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: image != null ? 12 : 0 left: image != null ? 12 : 0
), ),
child: Text( child: Text(
item.toString(), item.toString(),
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
color: textColor, color: textColor,
decoration: TextDecoration.none, 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)
), ],
)
); );
} }
} }

View file

@ -1,6 +1,5 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
class PrimaryButton extends StatelessWidget { class PrimaryButton extends StatelessWidget {
const PrimaryButton( const PrimaryButton(
@ -38,7 +37,7 @@ class PrimaryButton extends StatelessWidget {
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: isDisabled color: isDisabled
? Colors.grey.withOpacity(0.5) ? textColor.withOpacity(0.5)
: textColor)), : textColor)),
)); ));
} }
@ -78,7 +77,7 @@ class LoadingPrimaryButton extends StatelessWidget {
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: isDisabled color: isDisabled
? Colors.grey.withOpacity(0.5) ? textColor.withOpacity(0.5)
: textColor : textColor
)), )),
)); ));

View file

@ -1,65 +1,82 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class StandartListRow extends StatelessWidget { class StandartListRow extends StatelessWidget {
StandartListRow( StandartListRow(
{this.title, {this.title,
this.value, this.value,
this.isDrawTop = false, this.titleFontSize = 14,
this.valueFontSize = 16,
this.image,
this.isDrawBottom = false}); this.isDrawBottom = false});
final String title; final String title;
final String value; final String value;
final bool isDrawTop; final double titleFontSize;
final double valueFontSize;
final Image image;
final bool isDrawBottom; final bool isDrawBottom;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: <Widget>[ children: <Widget>[
isDrawTop
? Container(
width: double.infinity,
height: 1,
color: Theme.of(context).dividerColor,
)
: Offstage(),
Container( Container(
width: double.infinity, width: double.infinity,
color: Theme.of(context).accentTextTheme.title.backgroundColor, color: Theme.of(context).backgroundColor,
child: Padding( child: Padding(
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( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text(title, Text(title,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: titleFontSize,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
color: color:
Theme.of(context).primaryTextTheme.caption.color), Theme.of(context).primaryTextTheme.overline.color),
textAlign: TextAlign.left), textAlign: TextAlign.left),
Padding( Padding(
padding: const EdgeInsets.only(top: 12), padding: const EdgeInsets.only(top: 12),
child: Text(value, child: Row(
style: TextStyle( mainAxisSize: MainAxisSize.max,
fontSize: 16, mainAxisAlignment: MainAxisAlignment.spaceBetween,
fontWeight: FontWeight.w500, crossAxisAlignment: CrossAxisAlignment.start,
color: Theme.of(context) children: <Widget>[
.primaryTextTheme Expanded(
.title child: Text(value,
.color)), 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 isDrawBottom
? Container( ? Container(
width: double.infinity, height: 1,
height: 1, padding: EdgeInsets.only(left: 24),
color: Theme.of(context).dividerColor, color: Theme.of(context).backgroundColor,
) child: Container(
: Offstage(), height: 1,
color: Theme.of(context).primaryTextTheme.title.backgroundColor,
),
)
: Offstage(),
], ],
); );
} }

View file

@ -1,77 +1,153 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
class TemplateTile extends StatelessWidget { class TemplateTile extends StatefulWidget {
TemplateTile({ TemplateTile({
Key key,
@required this.to, @required this.to,
@required this.amount, @required this.amount,
@required this.from, @required this.from,
@required this.onTap @required this.onTap,
}); @required this.onRemove
}) : super(key: key);
final String to; final String to;
final String amount; final String amount;
final String from; final String from;
final VoidCallback onTap; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final toIcon = Image.asset('assets/images/to_icon.png', final color = isRemovable ? Colors.white : Theme.of(context).primaryTextTheme.title.color;
color: Theme.of(context).primaryTextTheme.title.color, final toIcon = Image.asset('assets/images/to_icon.png', color: color);
);
return Container( final content = Row(
padding: EdgeInsets.only(right: 10), mainAxisAlignment: MainAxisAlignment.start,
child: GestureDetector( mainAxisSize: MainAxisSize.min,
onTap: onTap, children: <Widget>[
child: Container( Text(
height: 40, amount,
padding: EdgeInsets.only(left: 24, right: 24), style: TextStyle(
decoration: BoxDecoration( fontSize: 16,
borderRadius: BorderRadius.all(Radius.circular(20)), fontWeight: FontWeight.w600,
color: Theme.of(context).accentTextTheme.title.backgroundColor color: color
),
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
),
),
),
],
), ),
), ),
), 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;
} }
} }

View file

@ -2,25 +2,28 @@ import 'package:flutter/material.dart';
class TopPanel extends StatefulWidget { class TopPanel extends StatefulWidget {
TopPanel({ TopPanel({
@required this.color,
@required this.widget, @required this.widget,
this.edgeInsets = const EdgeInsets.all(24) this.edgeInsets = const EdgeInsets.all(24),
this.color,
this.gradient
}); });
final Color color; final Color color;
final Widget widget; final Widget widget;
final EdgeInsets edgeInsets; final EdgeInsets edgeInsets;
final Gradient gradient;
@override @override
TopPanelState createState() => TopPanelState(color, widget, edgeInsets); TopPanelState createState() => TopPanelState(widget, edgeInsets, color, gradient);
} }
class TopPanelState extends State<TopPanel> { 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 Color _color;
final Widget _widget; final Widget _widget;
final EdgeInsets _edgeInsets; final EdgeInsets _edgeInsets;
final Gradient _gradient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -32,7 +35,8 @@ class TopPanelState extends State<TopPanel> {
bottomLeft: Radius.circular(24), bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24) bottomRight: Radius.circular(24)
), ),
color: _color color: _color,
gradient: _gradient
), ),
child: _widget, child: _widget,
); );

View file

@ -21,7 +21,7 @@ class TrailButton extends StatelessWidget {
child: Text( child: Text(
caption, caption,
style: TextStyle( style: TextStyle(
color: Theme.of(context).primaryTextTheme.caption.color, color: Theme.of(context).textTheme.subhead.decorationColor,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 14), fontSize: 14),
), ),

View file

@ -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;
}
}

Some files were not shown because too many files have changed in this diff Show more