mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-24 11:36:21 +00:00
[skip ci] format files
This commit is contained in:
parent
658d4766c6
commit
03748d680a
5 changed files with 58 additions and 80 deletions
|
@ -8,7 +8,6 @@ part 'display_settings_view_model.g.dart';
|
|||
|
||||
class DisplaySettingsViewModel = DisplaySettingsViewModelBase with _$DisplaySettingsViewModel;
|
||||
|
||||
|
||||
abstract class DisplaySettingsViewModelBase with Store {
|
||||
DisplaySettingsViewModelBase(
|
||||
this._settingsStore,
|
||||
|
@ -22,10 +21,8 @@ abstract class DisplaySettingsViewModelBase with Store {
|
|||
@computed
|
||||
String get languageCode => _settingsStore.languageCode;
|
||||
|
||||
|
||||
@computed
|
||||
BalanceDisplayMode get balanceDisplayMode =>
|
||||
_settingsStore.balanceDisplayMode;
|
||||
BalanceDisplayMode get balanceDisplayMode => _settingsStore.balanceDisplayMode;
|
||||
|
||||
@computed
|
||||
bool get shouldDisplayBalance => balanceDisplayMode == BalanceDisplayMode.displayableBalance;
|
||||
|
@ -34,8 +31,7 @@ abstract class DisplaySettingsViewModelBase with Store {
|
|||
ThemeBase get theme => _settingsStore.currentTheme;
|
||||
|
||||
@action
|
||||
void setBalanceDisplayMode(BalanceDisplayMode value) =>
|
||||
_settingsStore.balanceDisplayMode = value;
|
||||
void setBalanceDisplayMode(BalanceDisplayMode value) => _settingsStore.balanceDisplayMode = value;
|
||||
|
||||
@action
|
||||
void setShouldDisplayBalance(bool value) {
|
||||
|
@ -57,7 +53,5 @@ abstract class DisplaySettingsViewModelBase with Store {
|
|||
}
|
||||
|
||||
@action
|
||||
void setFiatCurrency(FiatCurrency value) =>
|
||||
_settingsStore.fiatCurrency = value;
|
||||
|
||||
void setFiatCurrency(FiatCurrency value) => _settingsStore.fiatCurrency = value;
|
||||
}
|
|
@ -12,19 +12,15 @@ import 'package:package_info/package_info.dart';
|
|||
|
||||
part 'other_settings_view_model.g.dart';
|
||||
|
||||
class OtherSettingsViewModel = OtherSettingsViewModelBase
|
||||
with _$OtherSettingsViewModel;
|
||||
|
||||
class OtherSettingsViewModel = OtherSettingsViewModelBase with _$OtherSettingsViewModel;
|
||||
|
||||
abstract class OtherSettingsViewModelBase with Store {
|
||||
OtherSettingsViewModelBase(this._settingsStore, WalletBase<Balance, TransactionHistoryBase<TransactionInfo>,
|
||||
TransactionInfo>
|
||||
wallet):
|
||||
walletType = wallet.type,
|
||||
OtherSettingsViewModelBase(
|
||||
this._settingsStore, WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, TransactionInfo> wallet)
|
||||
: walletType = wallet.type,
|
||||
_wallet = wallet,
|
||||
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);
|
||||
|
@ -32,12 +28,10 @@ abstract class OtherSettingsViewModelBase with Store {
|
|||
if (!priorities.contains(priority)) {
|
||||
_settingsStore.priority[wallet.type] = priorities.first;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
final WalletType walletType;
|
||||
final WalletBase<Balance, TransactionHistoryBase<TransactionInfo>,
|
||||
TransactionInfo> _wallet;
|
||||
final WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, TransactionInfo> _wallet;
|
||||
|
||||
@observable
|
||||
String currentVersion;
|
||||
|
@ -58,8 +52,7 @@ abstract class OtherSettingsViewModelBase with Store {
|
|||
String getDisplayPriority(dynamic priority) {
|
||||
final _priority = priority as TransactionPriority;
|
||||
|
||||
if (_wallet.type == WalletType.bitcoin
|
||||
|| _wallet.type == WalletType.litecoin) {
|
||||
if (_wallet.type == WalletType.bitcoin || _wallet.type == WalletType.litecoin) {
|
||||
final rate = bitcoin!.getFeeRate(_wallet, _priority);
|
||||
return bitcoin!.bitcoinTransactionPriorityWithLabel(_priority, rate);
|
||||
}
|
||||
|
@ -67,6 +60,5 @@ 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;
|
||||
}
|
|
@ -3,8 +3,7 @@ import 'package:mobx/mobx.dart';
|
|||
|
||||
part 'privacy_settings_view_model.g.dart';
|
||||
|
||||
class PrivacySettingsViewModel = PrivacySettingsViewModelBase
|
||||
with _$PrivacySettingsViewModel;
|
||||
class PrivacySettingsViewModel = PrivacySettingsViewModelBase with _$PrivacySettingsViewModel;
|
||||
|
||||
abstract class PrivacySettingsViewModelBase with Store {
|
||||
PrivacySettingsViewModelBase(this._settingsStore);
|
||||
|
@ -15,14 +14,11 @@ abstract class PrivacySettingsViewModelBase with Store {
|
|||
bool get disableExchange => _settingsStore.disableExchange;
|
||||
|
||||
@computed
|
||||
bool get shouldSaveRecipientAddress =>
|
||||
_settingsStore.shouldSaveRecipientAddress;
|
||||
bool get shouldSaveRecipientAddress => _settingsStore.shouldSaveRecipientAddress;
|
||||
|
||||
@action
|
||||
void setShouldSaveRecipientAddress(bool value) =>
|
||||
_settingsStore.shouldSaveRecipientAddress = value;
|
||||
void setShouldSaveRecipientAddress(bool value) => _settingsStore.shouldSaveRecipientAddress = value;
|
||||
|
||||
@action
|
||||
void setEnableExchange(bool value) =>
|
||||
_settingsStore.disableExchange = value;
|
||||
void setEnableExchange(bool value) => _settingsStore.disableExchange = value;
|
||||
}
|
|
@ -4,8 +4,7 @@ import 'package:mobx/mobx.dart';
|
|||
|
||||
part 'security_settings_view_model.g.dart';
|
||||
|
||||
class SecuritySettingsViewModel = SecuritySettingsViewModelBase
|
||||
with _$SecuritySettingsViewModel;
|
||||
class SecuritySettingsViewModel = SecuritySettingsViewModelBase with _$SecuritySettingsViewModel;
|
||||
|
||||
abstract class SecuritySettingsViewModelBase with Store {
|
||||
SecuritySettingsViewModelBase(this._settingsStore) : _biometricAuth = BiometricAuth();
|
||||
|
@ -14,8 +13,7 @@ abstract class SecuritySettingsViewModelBase with Store {
|
|||
final SettingsStore _settingsStore;
|
||||
|
||||
@computed
|
||||
bool get allowBiometricalAuthentication =>
|
||||
_settingsStore.allowBiometricalAuthentication;
|
||||
bool get allowBiometricalAuthentication => _settingsStore.allowBiometricalAuthentication;
|
||||
|
||||
@action
|
||||
Future<bool> biometricAuthenticated() async {
|
||||
|
@ -23,7 +21,5 @@ abstract class SecuritySettingsViewModelBase with Store {
|
|||
}
|
||||
|
||||
@action
|
||||
void setAllowBiometricalAuthentication(bool value) =>
|
||||
_settingsStore.allowBiometricalAuthentication = value;
|
||||
|
||||
void setAllowBiometricalAuthentication(bool value) => _settingsStore.allowBiometricalAuthentication = value;
|
||||
}
|
Loading…
Reference in a new issue