mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-02-02 19:26:27 +00:00
Merge branch 'master' into CWA-167-amount-entering-bug
This commit is contained in:
commit
40f3729d24
8 changed files with 30 additions and 31 deletions
|
@ -33,7 +33,7 @@ Future defaultSettingsMigration(
|
|||
'current_fee_priority', TransactionPriority.standart.raw);
|
||||
await sharedPreferences.setInt('current_balance_display_mode',
|
||||
BalanceDisplayMode.availableBalance.raw);
|
||||
await sharedPreferences.setBool('save_recipient_address', false);
|
||||
await sharedPreferences.setBool('save_recipient_address', true);
|
||||
await resetToDefault(nodes);
|
||||
await changeCurrentNodeToDefault(
|
||||
sharedPreferences: sharedPreferences, nodes: nodes);
|
||||
|
|
|
@ -178,13 +178,13 @@ class AddressBookPage extends BasePage {
|
|||
color = Palette.cakeGreenWithOpacity;
|
||||
break;
|
||||
case CryptoCurrency.ada:
|
||||
color = Colors.blueGrey[700];
|
||||
color = Colors.blue[200];
|
||||
break;
|
||||
case CryptoCurrency.bch:
|
||||
color = Colors.orangeAccent;
|
||||
break;
|
||||
case CryptoCurrency.bnb:
|
||||
color = Colors.yellow;
|
||||
color = Colors.blue;
|
||||
break;
|
||||
case CryptoCurrency.btc:
|
||||
color = Colors.orange;
|
||||
|
@ -193,7 +193,7 @@ class AddressBookPage extends BasePage {
|
|||
color = Colors.blue;
|
||||
break;
|
||||
case CryptoCurrency.eos:
|
||||
color = Colors.deepPurple;
|
||||
color = Colors.orangeAccent;
|
||||
break;
|
||||
case CryptoCurrency.eth:
|
||||
color = Colors.black;
|
||||
|
@ -202,19 +202,19 @@ class AddressBookPage extends BasePage {
|
|||
color = Colors.blue[200];
|
||||
break;
|
||||
case CryptoCurrency.nano:
|
||||
color = Colors.blue[900];
|
||||
color = Colors.orange;
|
||||
break;
|
||||
case CryptoCurrency.trx:
|
||||
color = Colors.red;
|
||||
color = Colors.black;
|
||||
break;
|
||||
case CryptoCurrency.usdt:
|
||||
color = Colors.teal;
|
||||
color = Colors.blue[200];
|
||||
break;
|
||||
case CryptoCurrency.xlm:
|
||||
color = Colors.grey[100];
|
||||
color = color = Colors.blue;
|
||||
break;
|
||||
case CryptoCurrency.xrp:
|
||||
color = Colors.blueAccent;
|
||||
color = Colors.orangeAccent;
|
||||
break;
|
||||
default:
|
||||
color = Colors.white;
|
||||
|
@ -229,14 +229,10 @@ class AddressBookPage extends BasePage {
|
|||
color = Palette.cakeGreen;
|
||||
break;
|
||||
case CryptoCurrency.ltc:
|
||||
case CryptoCurrency.ada:
|
||||
case CryptoCurrency.usdt:
|
||||
color = Palette.lightBlue;
|
||||
break;
|
||||
case CryptoCurrency.xlm:
|
||||
color = Colors.blueAccent;
|
||||
break;
|
||||
case CryptoCurrency.xrp:
|
||||
color = Colors.black;
|
||||
break;
|
||||
default:
|
||||
color = Colors.white;
|
||||
}
|
||||
|
|
|
@ -50,10 +50,7 @@ class NodeListPage extends BasePage {
|
|||
onPressed: () async {
|
||||
Navigator.pop(context);
|
||||
await nodeList.reset();
|
||||
if (nodeList.nodes.isNotEmpty) {
|
||||
await settings.setCurrentNode(
|
||||
node: nodeList.nodes[0]);
|
||||
}
|
||||
await settings.setCurrentNodeToDefault();
|
||||
},
|
||||
child: Text(S.of(context).reset))
|
||||
],
|
||||
|
|
|
@ -45,15 +45,15 @@ abstract class AddressBookStoreBase with Store {
|
|||
}
|
||||
|
||||
void validateAddress(String value, {CryptoCurrency cryptoCurrency}) {
|
||||
// XMR (95), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// XMR (95, 106), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// ETH (42), LTC (34), NANO (64, 65), TRX (34), USDT (42), XLM (56), XRP (34)
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z_]{64}\$|^[0-9a-zA-Z_]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$';
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z_]{64}\$|^[0-9a-zA-Z_]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$|^[0-9a-zA-Z]{106}\$';
|
||||
final regExp = RegExp(pattern);
|
||||
isValid = regExp.hasMatch(value);
|
||||
if (isValid && cryptoCurrency != null) {
|
||||
switch (cryptoCurrency) {
|
||||
case CryptoCurrency.xmr:
|
||||
isValid = (value.length == 95);
|
||||
isValid = (value.length == 95)||(value.length == 106);
|
||||
break;
|
||||
case CryptoCurrency.ada:
|
||||
isValid = (value.length == 59)||(value.length == 92)||(value.length == 105);
|
||||
|
|
|
@ -226,15 +226,15 @@ abstract class ExchangeStoreBase with Store {
|
|||
}
|
||||
|
||||
void validateAddress(String value, {CryptoCurrency cryptoCurrency}) {
|
||||
// XMR (95), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// XMR (95, 106), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// ETH (42), LTC (34), NANO (64, 65), TRX (34), USDT (42), XLM (56), XRP (34)
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z_]{64}\$|^[0-9a-zA-Z_]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$';
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z_]{64}\$|^[0-9a-zA-Z_]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$|^[0-9a-zA-Z]{106}\$';
|
||||
final regExp = RegExp(pattern);
|
||||
isValid = regExp.hasMatch(value);
|
||||
if (isValid && cryptoCurrency != null) {
|
||||
switch (cryptoCurrency) {
|
||||
case CryptoCurrency.xmr:
|
||||
isValid = (value.length == 95);
|
||||
isValid = (value.length == 95)||(value.length == 106);
|
||||
break;
|
||||
case CryptoCurrency.ada:
|
||||
isValid = (value.length == 59)||(value.length == 92)||(value.length == 105);
|
||||
|
|
|
@ -155,15 +155,15 @@ abstract class SendStoreBase with Store {
|
|||
}
|
||||
|
||||
void validateAddress(String value, {CryptoCurrency cryptoCurrency}) {
|
||||
// XMR (95), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// XMR (95, 106), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// ETH (42), LTC (34), NANO (64, 65), TRX (34), USDT (42), XLM (56), XRP (34)
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z_]{64}\$|^[0-9a-zA-Z_]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$';
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z_]{64}\$|^[0-9a-zA-Z_]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$|^[0-9a-zA-Z]{106}\$';
|
||||
final regExp = RegExp(pattern);
|
||||
isValid = regExp.hasMatch(value);
|
||||
if (isValid && cryptoCurrency != null) {
|
||||
switch (cryptoCurrency) {
|
||||
case CryptoCurrency.xmr:
|
||||
isValid = (value.length == 95);
|
||||
isValid = (value.length == 95)||(value.length == 106);
|
||||
break;
|
||||
case CryptoCurrency.ada:
|
||||
isValid = (value.length == 59)||(value.length == 92)||(value.length == 105);
|
||||
|
|
|
@ -11,6 +11,7 @@ import 'package:cake_wallet/src/domain/common/transaction_priority.dart';
|
|||
import 'package:cake_wallet/src/stores/action_list/action_list_display_mode.dart';
|
||||
import 'package:cake_wallet/src/screens/settings/items/item_headers.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/domain/common/default_settings_migration.dart';
|
||||
|
||||
part 'settings_store.g.dart';
|
||||
|
||||
|
@ -266,4 +267,9 @@ abstract class SettingsStoreBase with Store {
|
|||
ItemHeaders.faq: S.current.faq
|
||||
});
|
||||
}
|
||||
|
||||
Future setCurrentNodeToDefault() async {
|
||||
await changeCurrentNodeToDefault(sharedPreferences: _sharedPreferences, nodes: _nodes);
|
||||
await loadSettings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,15 +116,15 @@ abstract class WalleRestorationStoreBase with Store {
|
|||
}
|
||||
|
||||
void validateAddress(String value, {CryptoCurrency cryptoCurrency}) {
|
||||
// XMR (95), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// XMR (95, 106), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// ETH (42), LTC (34), NANO (64, 65), TRX (34), USDT (42), XLM (56), XRP (34)
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z_]{64}\$|^[0-9a-zA-Z_]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$';
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z_]{64}\$|^[0-9a-zA-Z_]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$|^[0-9a-zA-Z]{106}\$';
|
||||
final regExp = RegExp(pattern);
|
||||
isValid = regExp.hasMatch(value);
|
||||
if (isValid && cryptoCurrency != null) {
|
||||
switch (cryptoCurrency) {
|
||||
case CryptoCurrency.xmr:
|
||||
isValid = (value.length == 95);
|
||||
isValid = (value.length == 95)||(value.length == 106);
|
||||
break;
|
||||
case CryptoCurrency.ada:
|
||||
isValid = (value.length == 59)||(value.length == 92)||(value.length == 105);
|
||||
|
|
Loading…
Reference in a new issue