mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 20:19:25 +00:00
698c222291
* Change order of currencies in currency picker * Disable Background sync until implemented properly * remove ability to use device pin in bio auth * Fix condition * Minor fix [skip ci] * make notifications red dot go when opened * Update Frozen coin text color * Update Frozen coin text color * Fetch internal transactions for eth and polygon * Remove debug prints [skip ci] * Fix Camera permission on iOS [skip ci] --------- Co-authored-by: tuxsudo <tuxsudo@tux.pizza>
32 lines
776 B
Dart
32 lines
776 B
Dart
import 'package:local_auth/local_auth.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
|
|
|
class BiometricAuth {
|
|
final _localAuth = LocalAuthentication();
|
|
|
|
Future<bool> isAuthenticated() async {
|
|
try {
|
|
return await _localAuth.authenticate(
|
|
localizedReason: S.current.biometric_auth_reason,
|
|
options: AuthenticationOptions(
|
|
biometricOnly: true,
|
|
useErrorDialogs: true,
|
|
stickyAuth: false));
|
|
} on PlatformException catch (e) {
|
|
print(e);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
Future<bool> canCheckBiometrics() async {
|
|
try {
|
|
return await _localAuth.canCheckBiometrics;
|
|
} on PlatformException catch (e) {
|
|
print(e);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|