- Add whether this provide supports fixed rate or not

- Fix Change now fixed rate exchange due to wrong rate id
This commit is contained in:
OmarHatem
2022-12-06 19:23:46 +02:00
parent e65bd87f06
commit f14c01303f
7 changed files with 31 additions and 13 deletions
@@ -306,10 +306,11 @@ abstract class ExchangeViewModelBase with Store {
}
Future<void> _calculateBestRate() async {
final amount = double.tryParse(depositAmount) ?? 1;
final amount = double.tryParse(isFixedRateMode ? receiveAmount : depositAmount) ?? 1;
final result = await Future.wait<double>(
_tradeAvailableProviders
.where((element) => element.supportsFixedRate)
.map((element) => element.calculateAmount(
from: depositCurrency,
to: receiveCurrency,