cake_wallet/lib/entities/biometric_auth.dart
Matthew Fosse e6b4b08c24
version bump to 3.13.9, auth working on mac (#1367)
* version bump to 3.13.9, auth working on mac

* bump flutter version in workflow file

* workflow fix

* test fix

* downgrade flutter version

* test fix

* test fix

* update gradle version

* fixes for updated dart version, localization file updates

* remove accidental inclusion

* missed some unimplemented throws
2024-04-18 19:00:24 +02:00

28 lines
753 B
Dart

import 'package:flutter/services.dart';
import 'package:flutter_local_authentication/flutter_local_authentication.dart';
class BiometricAuth {
final _flutterLocalAuthenticationPlugin = FlutterLocalAuthentication();
Future<bool> isAuthenticated() async {
try {
final authenticated = await _flutterLocalAuthenticationPlugin.authenticate();
return authenticated;
} catch (e) {
print(e);
}
return false;
}
Future<bool> canCheckBiometrics() async {
bool canAuthenticate;
try {
canAuthenticate = await _flutterLocalAuthenticationPlugin.canAuthenticate();
} catch (error) {
print("Exception checking support. $error");
canAuthenticate = false;
}
return canAuthenticate;
}
}