cake_wallet/lib/src/domain/common/biometric_auth.dart
2020-01-21 19:51:37 +02:00

24 lines
No EOL
554 B
Dart

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;
}
}