mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
CW-240 Receive fiat currency amount and receive animations (#877)
* Redesign receive amount field * Fix issues with animations * Fix issues with animations * Fix max fraction digit to 8 * add another 0 * Update amount when currency is changed --------- Co-authored-by: Justin Ehrenhofer <justin.ehrenhofer@gmail.com> Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
8ffac75e8c
commit
f2b8dd21a1
13 changed files with 504 additions and 340 deletions
|
@ -1,6 +1,7 @@
|
|||
import 'package:cake_wallet/core/validator.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/currency.dart';
|
||||
|
||||
class AmountValidator extends TextValidator {
|
||||
AmountValidator({
|
||||
|
@ -57,7 +58,7 @@ class SymbolsAmountValidator extends TextValidator {
|
|||
}
|
||||
|
||||
class DecimalAmountValidator extends TextValidator {
|
||||
DecimalAmountValidator({required CryptoCurrency currency, required bool isAutovalidate })
|
||||
DecimalAmountValidator({required Currency currency, required bool isAutovalidate })
|
||||
: super(
|
||||
errorMessage: S.current.decimal_places_error,
|
||||
pattern: _pattern(currency),
|
||||
|
@ -65,7 +66,7 @@ class DecimalAmountValidator extends TextValidator {
|
|||
minLength: 0,
|
||||
maxLength: 0);
|
||||
|
||||
static String _pattern(CryptoCurrency currency) {
|
||||
static String _pattern(Currency currency) {
|
||||
switch (currency) {
|
||||
case CryptoCurrency.xmr:
|
||||
return '^([0-9]+([.\,][0-9]{1,12})?|[.\,][0-9]{1,12})\$';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue