allow null minimum amount in limits

This commit is contained in:
OmarHatem 2022-12-01 22:37:13 +02:00
parent dd99508d3e
commit 091ac41ee2

View file

@ -336,7 +336,7 @@ abstract class ExchangeViewModelBase with Store {
? depositCurrency
: receiveCurrency;
double lowestMin = double.maxFinite;
double? lowestMin = double.maxFinite;
double? highestMax = 0.0;
for (var provider in selectedProviders) {
@ -351,8 +351,8 @@ abstract class ExchangeViewModelBase with Store {
to: to,
isFixedRateMode: isFixedRateMode);
if (tempLimits.min != null && tempLimits.min! < lowestMin) {
lowestMin = tempLimits.min!;
if (lowestMin != null && (tempLimits.min ?? -1) < lowestMin) {
lowestMin = tempLimits.min;
}
if (highestMax != null && (tempLimits.max ?? double.maxFinite) > highestMax) {
highestMax = tempLimits.max;
@ -362,7 +362,7 @@ abstract class ExchangeViewModelBase with Store {
}
}
if (lowestMin < double.maxFinite) {
if (lowestMin != double.maxFinite) {
limits = Limits(min: lowestMin, max: highestMax);
limitsState = LimitsLoadedSuccessfully(limits: limits);