Merge branch 'master' into CWA-164-add-biometric-authentication

# Conflicts:
#	pubspec.yaml
#	res/values/strings_de.arb
#	res/values/strings_en.arb
#	res/values/strings_es.arb
#	res/values/strings_hi.arb
#	res/values/strings_ja.arb
#	res/values/strings_ko.arb
#	res/values/strings_nl.arb
#	res/values/strings_pl.arb
#	res/values/strings_pt.arb
#	res/values/strings_ru.arb
#	res/values/strings_zh.arb
This commit is contained in:
Oleksandr Sobol
2020-02-05 19:45:22 +02:00
26 changed files with 107 additions and 38 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;
}
@@ -112,7 +112,7 @@ class DashboardPageBody extends StatefulWidget {
}
class DashboardPageBodyState extends State<DashboardPageBody> {
static final transactionDateFormat = DateFormat("MMM d, yyyy HH:mm");
static final transactionDateFormat = DateFormat("MMMM d, yyyy HH:mm");
final _connectionStatusObserverKey = GlobalKey();
final _balanceObserverKey = GlobalKey();
@@ -566,7 +566,7 @@ class DashboardPageBodyState extends State<DashboardPageBody> {
from: trade.from,
to: trade.to,
createdAtFormattedDate:
DateFormat("dd.MM.yyyy, H:m").format(trade.createdAt),
transactionDateFormat.format(trade.createdAt),
formattedAmount: formattedAmount);
}
@@ -174,7 +174,7 @@ class ExchangeCardState extends State<ExchangeCard> {
enabled: _isAmountEditable,
textAlign: TextAlign.right,
keyboardType: TextInputType.numberWithOptions(
signed: false, decimal: false),
signed: false, decimal: true),
inputFormatters: [
BlacklistingTextInputFormatter(
RegExp('[\\-|\\ |\\,]'))
+2 -2
View File
@@ -215,7 +215,7 @@ class SendFormState extends State<SendForm> {
.color),
controller: _cryptoAmountController,
keyboardType: TextInputType.numberWithOptions(
signed: false, decimal: false),
signed: false, decimal: true),
inputFormatters: [
BlacklistingTextInputFormatter(
RegExp('[\\-|\\ |\\,]'))
@@ -275,7 +275,7 @@ class SendFormState extends State<SendForm> {
.color),
controller: _fiatAmountController,
keyboardType: TextInputType.numberWithOptions(
signed: false, decimal: false),
signed: false, decimal: true),
inputFormatters: [
BlacklistingTextInputFormatter(
RegExp('[\\-|\\ |\\,]'))
@@ -14,4 +14,5 @@ class ItemHeaders {
static const support = 'Support';
static const termsAndConditions = 'Terms and conditions';
static const faq = 'FAQ';
static const version = 'Version';
}
+9 -5
View File
@@ -343,9 +343,9 @@ class SettingsFormState extends State<SettingsForm> {
final item = _items[index];
bool _isDrawDivider = true;
if (item.attribute == Attributes.header) {
if (item.attribute == Attributes.header || item == _items.last) {
_isDrawDivider = false;
} else if (index < _items.length - 1) {
} else {
if (_items[index + 1].attribute == Attributes.header) {
_isDrawDivider = false;
}
@@ -373,9 +373,13 @@ class SettingsFormState extends State<SettingsForm> {
],
);
}),
Container(
height: 20.0,
color: Theme.of(context).accentTextTheme.headline.backgroundColor,
ListTile(
contentPadding: EdgeInsets.only(left: 20.0),
title: Text(
settingsStore.itemHeaders[ItemHeaders.version],
style: TextStyle(
fontSize: 14.0, color: Palette.wildDarkBlue)
),
)
],
));
@@ -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);
+3 -3
View File
@@ -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);
+3 -3
View File
@@ -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);
+7 -1
View File
@@ -12,6 +12,7 @@ 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';
import 'package:package_info/package_info.dart';
part 'settings_store.g.dart';
@@ -46,6 +47,9 @@ abstract class SettingsStoreBase with Store {
(dynamic _) => _sharedPreferences.setInt(displayActionListModeKey,
serializeActionlistDisplayModes(actionlistDisplayMode)),
fireImmediately: false);
PackageInfo.fromPlatform().then((PackageInfo packageInfo) => currentVersion = packageInfo.version);
}
static const currentNodeIdKey = 'current_node_id';
@@ -143,6 +147,7 @@ abstract class SettingsStoreBase with Store {
SharedPreferences _sharedPreferences;
Box<Node> _nodes;
String currentVersion;
@action
Future setAllowBiometricalAuthentication(
@@ -264,7 +269,8 @@ abstract class SettingsStoreBase with Store {
ItemHeaders.darkMode: S.current.settings_dark_mode,
ItemHeaders.support: S.current.settings_support,
ItemHeaders.termsAndConditions: S.current.settings_terms_and_conditions,
ItemHeaders.faq: S.current.faq
ItemHeaders.faq: S.current.faq,
ItemHeaders.version: S.current.version(currentVersion)
});
}
@@ -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);