CW-243-Better-error-message-for-too-many-decimals (#818)

* update amoung validation

* fix decimal validator

* minor fix
This commit is contained in:
Serhii
2023-03-15 19:22:08 +02:00
committed by GitHub
parent fc2627df38
commit 7dfc5b23bc
29 changed files with 78 additions and 23 deletions
+2 -2
View File
@@ -240,7 +240,7 @@ class ExchangePage extends BasePage {
.bodyText1!
.color!,
currencyValueValidator: AmountValidator(
type: exchangeViewModel.wallet.type),
currency: exchangeViewModel.depositCurrency),
addressTextFieldValidator: AddressValidator(
type: exchangeViewModel.depositCurrency),
onPushPasteButton: (context) async {
@@ -304,7 +304,7 @@ class ExchangePage extends BasePage {
.bodyText1!
.decorationColor!,
currencyValueValidator: AmountValidator(
type: exchangeViewModel.wallet.type),
currency: exchangeViewModel.receiveCurrency),
addressTextFieldValidator:
AddressValidator(
type: exchangeViewModel
@@ -165,7 +165,7 @@ class ExchangeTemplatePage extends BasePage {
.bodyText1!
.color!,
currencyValueValidator: AmountValidator(
type: exchangeViewModel.wallet.type),
currency: exchangeViewModel.depositCurrency),
//addressTextFieldValidator: AddressValidator(
// type: exchangeViewModel.depositCurrency),
),
@@ -206,7 +206,7 @@ class ExchangeTemplatePage extends BasePage {
.bodyText1!
.decorationColor!,
currencyValueValidator: AmountValidator(
type: exchangeViewModel.wallet.type),
currency: exchangeViewModel.receiveCurrency),
//addressTextFieldValidator: AddressValidator(
// type: exchangeViewModel.receiveCurrency),
)),
@@ -1,5 +1,6 @@
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:device_display_brightness/device_display_brightness.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
@@ -119,7 +120,8 @@ class QRWidget extends StatelessWidget {
hintText: S.of(context).receive_amount,
textColor: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!,
borderColor: Theme.of(context).textTheme!.headline5!.decorationColor!,
validator: AmountValidator(type: addressListViewModel.type, isAutovalidate: true),
validator: AmountValidator(currency:
walletTypeToCryptoCurrency(addressListViewModel.type), isAutovalidate: true),
// FIX-ME: Check does it equal to autovalidate: true,
autovalidateMode: AutovalidateMode.always,
placeholderTextStyle: TextStyle(