From 914fffe51cdec4ba880032dd53cfe925328daefa Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Thu, 1 Dec 2022 21:33:17 +0200 Subject: [PATCH] Initialize wallet directly from constructor argument [skip ci] --- .../settings/other_settings_view_model.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/view_model/settings/other_settings_view_model.dart b/lib/view_model/settings/other_settings_view_model.dart index b964adc6e..c57af50d9 100644 --- a/lib/view_model/settings/other_settings_view_model.dart +++ b/lib/view_model/settings/other_settings_view_model.dart @@ -15,18 +15,17 @@ part 'other_settings_view_model.g.dart'; class OtherSettingsViewModel = OtherSettingsViewModelBase with _$OtherSettingsViewModel; abstract class OtherSettingsViewModelBase with Store { - OtherSettingsViewModelBase( - this._settingsStore, WalletBase, TransactionInfo> wallet) - : walletType = wallet.type, - _wallet = wallet, + OtherSettingsViewModelBase(this._settingsStore, this._wallet) + : walletType = _wallet.type, currentVersion = '' { - PackageInfo.fromPlatform().then((PackageInfo packageInfo) => currentVersion = packageInfo.version); + PackageInfo.fromPlatform() + .then((PackageInfo packageInfo) => currentVersion = packageInfo.version); - final priority = _settingsStore.priority[wallet.type]; - final priorities = priorityForWalletType(wallet.type); + final priority = _settingsStore.priority[_wallet.type]; + final priorities = priorityForWalletType(_wallet.type); if (!priorities.contains(priority)) { - _settingsStore.priority[wallet.type] = priorities.first; + _settingsStore.priority[_wallet.type] = priorities.first; } } @@ -60,5 +59,6 @@ abstract class OtherSettingsViewModelBase with Store { return priority.toString(); } - void onDisplayPrioritySelected(TransactionPriority priority) => _settingsStore.priority[_wallet.type] = priority; + void onDisplayPrioritySelected(TransactionPriority priority) => + _settingsStore.priority[_wallet.type] = priority; }