mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-27 13:06:07 +00:00
29 lines
919 B
Dart
29 lines
919 B
Dart
|
import 'package:cake_wallet/entities/biometric_auth.dart';
|
||
|
import 'package:cake_wallet/store/settings_store.dart';
|
||
|
import 'package:mobx/mobx.dart';
|
||
|
|
||
|
part 'security_settings_view_model.g.dart';
|
||
|
|
||
|
class SecuritySettingsViewModel = SecuritySettingsViewModelBase
|
||
|
with _$SecuritySettingsViewModel;
|
||
|
|
||
|
abstract class SecuritySettingsViewModelBase with Store {
|
||
|
SecuritySettingsViewModelBase(this._settingsStore): _biometricAuth = BiometricAuth();
|
||
|
|
||
|
final BiometricAuth _biometricAuth;
|
||
|
final SettingsStore _settingsStore;
|
||
|
|
||
|
@computed
|
||
|
bool get allowBiometricalAuthentication =>
|
||
|
_settingsStore.allowBiometricalAuthentication;
|
||
|
|
||
|
@action
|
||
|
Future<bool> biometricAuthenticated()async{
|
||
|
return await _biometricAuth.canCheckBiometrics() && await _biometricAuth.isAuthenticated();
|
||
|
}
|
||
|
|
||
|
@action
|
||
|
void setAllowBiometricalAuthentication(bool value) =>
|
||
|
_settingsStore.allowBiometricalAuthentication = value;
|
||
|
|
||
|
}
|