Cw 188 fix grey screen (#537)

* Fix late initialization exception when using late with Mobx
Fix index out of range exception in picker

* Add haven account list class to configure file to be generated in haven.dart
This commit is contained in:
Omar Hatem
2022-10-17 17:01:50 -04:00
committed by GitHub
parent 6fbc658156
commit da6fd9a9ff
3 changed files with 32 additions and 31 deletions
@@ -9,22 +9,21 @@ class BuyAmountViewModel = BuyAmountViewModelBase with _$BuyAmountViewModel;
abstract class BuyAmountViewModelBase with Store {
BuyAmountViewModelBase()
: amount = '' {
: amount = '',
fiatCurrency = FiatCurrency.usd {
int selectedIndex = FiatCurrency.currenciesAvailableToBuyWith
.indexOf(getIt.get<SettingsStore>().fiatCurrency);
if (selectedIndex == -1) {
selectedIndex = FiatCurrency.currenciesAvailableToBuyWith
.indexOf(FiatCurrency.usd);
if (selectedIndex != -1) {
fiatCurrency = FiatCurrency.currenciesAvailableToBuyWith[selectedIndex];
}
fiatCurrency = FiatCurrency.currenciesAvailableToBuyWith[selectedIndex];
}
@observable
String amount;
@observable
late FiatCurrency fiatCurrency;
FiatCurrency fiatCurrency;
@computed
double get doubleAmount {