mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-05-04 12:22:13 +00:00
Initialize wallet directly from constructor argument [skip ci]
This commit is contained in:
parent
03748d680a
commit
914fffe51c
1 changed files with 9 additions and 9 deletions
|
@ -15,18 +15,17 @@ part 'other_settings_view_model.g.dart';
|
||||||
class OtherSettingsViewModel = OtherSettingsViewModelBase with _$OtherSettingsViewModel;
|
class OtherSettingsViewModel = OtherSettingsViewModelBase with _$OtherSettingsViewModel;
|
||||||
|
|
||||||
abstract class OtherSettingsViewModelBase with Store {
|
abstract class OtherSettingsViewModelBase with Store {
|
||||||
OtherSettingsViewModelBase(
|
OtherSettingsViewModelBase(this._settingsStore, this._wallet)
|
||||||
this._settingsStore, WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, TransactionInfo> wallet)
|
: walletType = _wallet.type,
|
||||||
: walletType = wallet.type,
|
|
||||||
_wallet = wallet,
|
|
||||||
currentVersion = '' {
|
currentVersion = '' {
|
||||||
PackageInfo.fromPlatform().then((PackageInfo packageInfo) => currentVersion = packageInfo.version);
|
PackageInfo.fromPlatform()
|
||||||
|
.then((PackageInfo packageInfo) => currentVersion = packageInfo.version);
|
||||||
|
|
||||||
final priority = _settingsStore.priority[wallet.type];
|
final priority = _settingsStore.priority[_wallet.type];
|
||||||
final priorities = priorityForWalletType(wallet.type);
|
final priorities = priorityForWalletType(_wallet.type);
|
||||||
|
|
||||||
if (!priorities.contains(priority)) {
|
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();
|
return priority.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onDisplayPrioritySelected(TransactionPriority priority) => _settingsStore.priority[_wallet.type] = priority;
|
void onDisplayPrioritySelected(TransactionPriority priority) =>
|
||||||
|
_settingsStore.priority[_wallet.type] = priority;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue