mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-25 05:58:42 +01:00
CWA-164 | added biometric authentication
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
class BiometricAuth {
|
||||
|
||||
Future<bool> isAuthenticated() async {
|
||||
final LocalAuthentication _localAuth = LocalAuthentication();
|
||||
|
||||
try {
|
||||
return await _localAuth.authenticateWithBiometrics(
|
||||
localizedReason: S.current.biometric_auth_reason,
|
||||
useErrorDialogs: true,
|
||||
stickyAuth: false
|
||||
);
|
||||
} on PlatformException
|
||||
catch(e) {
|
||||
print(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user