diff --git a/lib/view_model/exchange/exchange_view_model.dart b/lib/view_model/exchange/exchange_view_model.dart index 5c1f696b8..d310e6278 100644 --- a/lib/view_model/exchange/exchange_view_model.dart +++ b/lib/view_model/exchange/exchange_view_model.dart @@ -192,7 +192,7 @@ abstract class ExchangeViewModelBase with Store { ObservableList get templates => _exchangeTemplateStore.templates; - + @computed TransactionPriority get transactionPriority { final priority = _settingsStore.priority[wallet.type]; @@ -308,10 +308,11 @@ abstract class ExchangeViewModelBase with Store { Future _calculateBestRate() async { final amount = double.tryParse(isFixedRateMode ? receiveAmount : depositAmount) ?? 1; + final _providers = _tradeAvailableProviders + .where((element) => !isFixedRateMode || element.supportsFixedRate).toList(); + final result = await Future.wait( - _tradeAvailableProviders - .where((element) => !isFixedRateMode || element.supportsFixedRate) - .map((element) => element.fetchRate( + _providers.map((element) => element.fetchRate( from: depositCurrency, to: receiveCurrency, amount: amount, @@ -324,7 +325,12 @@ abstract class ExchangeViewModelBase with Store { for (int i=0;i