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
commit 125e3b1547
26 changed files with 107 additions and 38 deletions

View file

@ -287,6 +287,7 @@ class S implements WidgetsLocalizations {
String trade_id_not_found(String tradeId, String title) => "Trade ${tradeId} of ${title} not found.";
String trade_is_powered_by(String provider) => "This trade is powered by ${provider}";
String transaction_details_copied(String title) => "${title} copied to Clipboard";
String version(String currentVersion) => "Version ${currentVersion}";
String wallet_list_failed_to_load(String wallet_name, String error) => "Failed to load ${wallet_name} wallet. ${error}";
String wallet_list_failed_to_remove(String wallet_name, String error) => "Failed to remove ${wallet_name} wallet. ${error}";
String wallet_list_loading_wallet(String wallet_name) => "Loading ${wallet_name} wallet";
@ -800,6 +801,8 @@ class $de extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "Wird geladen ${wallet_name} Wallet";
@override
String version(String currentVersion) => "Ausführung ${currentVersion}";
@override
String router_no_route(String name) => "Keine Route definiert für ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "Handel ${tradeId} von ${title} nicht gefunden.";
@ -1348,6 +1351,8 @@ class $hi extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "लोड हो रहा है ${wallet_name} बटुआ";
@override
String version(String currentVersion) => "संस्करण ${currentVersion}";
@override
String router_no_route(String name) => "के लिए कोई मार्ग निर्धारित नहीं है ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "व्यापार ${tradeId} of ${title} नहीं मिला.";
@ -1896,6 +1901,8 @@ class $ru extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "Загрузка ${wallet_name} кошелька";
@override
String version(String currentVersion) => "Версия ${currentVersion}";
@override
String router_no_route(String name) => "Экран не найден ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "Сделка ${tradeId} ${title} не найдена.";
@ -2444,6 +2451,8 @@ class $ko extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "로딩 ${wallet_name} 지갑";
@override
String version(String currentVersion) => "버전 ${currentVersion}";
@override
String router_no_route(String name) => "에 정의 된 경로가 없습니다 ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "무역 ${tradeId}${title} 찾을 수 없습니다.";
@ -2992,6 +3001,8 @@ class $pt extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "Abrindo a carteira ${wallet_name}";
@override
String version(String currentVersion) => "Versão ${currentVersion}";
@override
String router_no_route(String name) => "Nenhuma rota definida para ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "A troca ${tradeId} de ${title} não foi encontrada.";
@ -3540,6 +3551,8 @@ class $ja extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "読み込み中 ${wallet_name} 財布";
@override
String version(String currentVersion) => "バージョン ${currentVersion}";
@override
String router_no_route(String name) => "ルートが定義されていません ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "トレード ${tradeId} of ${title} 見つかりません";
@ -4092,6 +4105,8 @@ class $pl extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "Ładuję ${wallet_name} portfel";
@override
String version(String currentVersion) => "Wersja ${currentVersion}";
@override
String router_no_route(String name) => "Brak zdefiniowanej trasy dla ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "Handel ${tradeId} of ${title} nie znaleziono.";
@ -4640,6 +4655,8 @@ class $es extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "Billetera ${wallet_name} de carga";
@override
String version(String currentVersion) => "Versión ${currentVersion}";
@override
String router_no_route(String name) => "No hay ruta definida para ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "Comercio ${tradeId} de ${title} no encontrado.";
@ -5188,6 +5205,8 @@ class $nl extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "Bezig met laden ${wallet_name} portemonnee";
@override
String version(String currentVersion) => "Versie ${currentVersion}";
@override
String router_no_route(String name) => "Geen route gedefinieerd voor ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "Handel ${tradeId} van ${title} niet gevonden.";
@ -5736,6 +5755,8 @@ class $zh extends S {
@override
String wallet_list_loading_wallet(String wallet_name) => "载入中 ${wallet_name} 钱包";
@override
String version(String currentVersion) => "${currentVersion}";
@override
String router_no_route(String name) => "未定义路线 ${name}";
@override
String trade_id_not_found(String tradeId, String title) => "贸易方式 ${tradeId}${title} 未找到.";

View file

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

View file

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

View file

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

View file

@ -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('[\\-|\\ |\\,]'))

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('[\\-|\\ |\\,]'))

View file

@ -14,4 +14,5 @@ class ItemHeaders {
static const support = 'Support';
static const termsAndConditions = 'Terms and conditions';
static const faq = 'FAQ';
static const version = 'Version';
}

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

View file

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

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

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

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

View file

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

View file

@ -476,6 +476,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
package_info:
dependency: "direct main"
description:
name: package_info
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0+13"
package_resolver:
dependency: transitive
description:

View file

@ -46,6 +46,7 @@ dependencies:
hive: ^1.2.0
hive_flutter: ^0.2.1
local_auth: ^0.6.1
package_info: ^0.4.0+13
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "Der eingegebene Text ist ungültig.",
"biometric_auth_reason" : "Scannen Sie Ihren Fingerabdruck zur Authentifizierung"
"incorrect_seed" : "Der eingegebene Text ist ungültig.",
"version" : "Ausführung ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "The text entered is not valid.",
"biometric_auth_reason" : "Scan your fingerprint to authenticate"
"incorrect_seed" : "The text entered is not valid.",
"version" : "Version ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "El texto ingresado no es válido.",
"biometric_auth_reason" : "Escanee su huella digital para autenticar"
"incorrect_seed" : "El texto ingresado no es válido.",
"version" : "Versión ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "दर्ज किया गया पाठ मान्य नहीं है।",
"biometric_auth_reason" : "प्रमाणित करने के लिए अपने फ़िंगरप्रिंट को स्कैन करें"
"incorrect_seed" : "दर्ज किया गया पाठ मान्य नहीं है।",
"version" : "संस्करण ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "入力されたテキストは無効です。",
"biometric_auth_reason" : "प指紋をスキャンして認証する"
"incorrect_seed" : "入力されたテキストは無効です。",
"version" : "バージョン ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "입력하신 텍스트가 유효하지 않습니다.",
"biometric_auth_reason" : "지문을 스캔하여 인증"
"incorrect_seed" : "입력하신 텍스트가 유효하지 않습니다.",
"version" : "버전 ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "De ingevoerde tekst is niet geldig.",
"biometric_auth_reason" : "Scan uw vingerafdruk om te verifiëren"
"incorrect_seed" : "De ingevoerde tekst is niet geldig.",
"version" : "Versie ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "Wprowadzony tekst jest nieprawidłowy.",
"biometric_auth_reason" : "Zeskanuj swój odcisk palca, aby go uwierzytelnić"
"incorrect_seed" : "Wprowadzony tekst jest nieprawidłowy.",
"version" : "Wersja ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "O texto digitado não é válido.",
"biometric_auth_reason" : "Digitalize sua impressão digital para autenticar"
"incorrect_seed" : "O texto digitado não é válido.",
"version" : "Versão ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "Введенный текст некорректный.",
"biometric_auth_reason" : "Отсканируйте свой отпечаток пальца для аутентификации"
"incorrect_seed" : "Введенный текст некорректный.",
"version" : "Версия ${currentVersion}"
}

View file

@ -339,4 +339,7 @@
"incorrect_seed" : "输入的文字无效。",
"biometric_auth_reason" : "掃描指紋以進行身份驗證"
"incorrect_seed" : "输入的文字无效。",
"version" : "版 ${currentVersion}"
}