CAKE-20 | updated send and send template pages; added send_template_store and exchange_template_store; created base_send_widget; applied send_template_store to send_view_model; applied base_send_widget to send and send template pages; added properties to address_text_field, base_text_field and template_tile

This commit is contained in:
Oleksandr Sobol
2020-07-29 19:55:42 +03:00
parent d5f707f652
commit fe9deecd03
35 changed files with 1272 additions and 1055 deletions
+2 -2
View File
@@ -13,10 +13,10 @@ class AmountValidator extends TextValidator {
static String _pattern(WalletType type) {
switch (type) {
case WalletType.monero:
return '^([0-9]+([.][0-9]{0,12})?|[.][0-9]{1,12})\$';
return '^([0-9]+([.][0-9]{0,12})?|[.][0-9]{1,12}|ALL)\$';
case WalletType.bitcoin:
// FIXME: Incorrect pattern for bitcoin
return '^([0-9]+([.][0-9]{0,12})?|[.][0-9]{1,12})\$';
return '^([0-9]+([.][0-9]{0,12})?|[.][0-9]{1,12}|ALL)\$';
default:
return '';
}
+12
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
);
}
+2 -2
View File
@@ -27,7 +27,7 @@ class TextValidator extends Validator<String> {
@override
bool isValid(String value) {
if (value == null || value.isEmpty) {
return true;
return false;
}
return value.length > (minLength ?? 0) &&
@@ -42,4 +42,4 @@ class TextValidator extends Validator<String> {
class WalletNameValidator extends TextValidator {
WalletNameValidator()
: super(minLength: 1, maxLength: 15, pattern: '^[a-zA-Z0-9_]\$');
}
}