mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-13 14:14:41 +00:00
red warnings not on 0 for exchange
This commit is contained in:
parent
3dd27d9b53
commit
dd00e76623
2 changed files with 16 additions and 10 deletions
lib
|
@ -92,7 +92,9 @@ class ExchangeFormState extends ChangeNotifier {
|
|||
String get warning {
|
||||
if (reversed) {
|
||||
if (toTicker != null && toAmount != null) {
|
||||
if (minAmount != null && toAmount! < minAmount!) {
|
||||
if (minAmount != null &&
|
||||
toAmount! < minAmount! &&
|
||||
toAmount! > Decimal.zero) {
|
||||
return "Minimum amount ${minAmount!.toString()} ${toTicker!.toUpperCase()}";
|
||||
} else if (maxAmount != null && toAmount! > maxAmount!) {
|
||||
return "Maximum amount ${maxAmount!.toString()} ${toTicker!.toUpperCase()}";
|
||||
|
@ -100,7 +102,9 @@ class ExchangeFormState extends ChangeNotifier {
|
|||
}
|
||||
} else {
|
||||
if (fromTicker != null && fromAmount != null) {
|
||||
if (minAmount != null && fromAmount! < minAmount!) {
|
||||
if (minAmount != null &&
|
||||
fromAmount! < minAmount! &&
|
||||
fromAmount! > Decimal.zero) {
|
||||
return "Minimum amount ${minAmount!.toString()} ${fromTicker!.toUpperCase()}";
|
||||
} else if (maxAmount != null && fromAmount! > maxAmount!) {
|
||||
return "Maximum amount ${maxAmount!.toString()} ${fromTicker!.toUpperCase()}";
|
||||
|
|
|
@ -572,14 +572,16 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
|||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
unawaited(
|
||||
showFloatingFlushBar(
|
||||
type: FlushBarType.warning,
|
||||
message:
|
||||
"Estimated rate trade pair \"$fromTicker-$toTicker\" unavailable. Reverting to last estimated rate pair.",
|
||||
context: context,
|
||||
),
|
||||
);
|
||||
if (!(fromTicker == "-" || toTicker == "-")) {
|
||||
unawaited(
|
||||
showFloatingFlushBar(
|
||||
type: FlushBarType.warning,
|
||||
message:
|
||||
"Estimated rate trade pair \"$fromTicker-$toTicker\" unavailable. Reverting to last estimated rate pair.",
|
||||
context: context,
|
||||
),
|
||||
);
|
||||
}
|
||||
break;
|
||||
case ExchangeRateType.fixed:
|
||||
if (!(toTicker == "-" || fromTicker == "-")) {
|
||||
|
|
Loading…
Reference in a new issue