call method
dynamic
call()
Implementation
call() async {
final isDeviceSupported = await _localAuth.isDeviceSupported();
final biometricCheck = await _localAuth.canCheckBiometrics;
if (biometricCheck && isDeviceSupported) {
bool biometriaHabilitada = (await _sharedPreferencesHandler.get('biometria')) == "true";
bool isAuth = false;
print(biometriaHabilitada);
if (biometriaHabilitada) {
if ((await _sharedPreferencesHandler.get('autenticou')) == "false") {
// List<BiometricType> availableBiometrics =
// await _localAuth.getAvailableBiometrics();
// if (Platform.isIOS) {
// if (availableBiometrics.contains(BiometricType.face)) {
isAuth = await _localAuth.authenticate(
localizedReason: "Desbloqueie o acesso as informações com a autenticação do seu dispositivo",
authMessages: const <AuthMessages>[_androidStrings, _iosStrings],
options: const AuthenticationOptions(
biometricOnly: true,
sensitiveTransaction: false,
stickyAuth: true,
),
);
if (!isAuth) {
this.autenticacaoPage!();
await SharedPreferencesHandler().set('autenticou', "false");
} else {
await SharedPreferencesHandler().set('autenticou', "true");
this.homePage!();
}
return;
}
this.homePage!();
// else if (availableBiometrics
// .contains(BiometricType.fingerprint)) {
// isAuth = await _localAuth.authenticate(
// biometricOnly: true,
// localizedReason: "Desbloqueio com Touch ID",
// stickyAuth: true,
// sensitiveTransaction: false,
// iOSAuthStrings: _iosStrings);
// }
}
// else {
// isAuth = await _localAuth.authenticate(
// biometricOnly: true,
// localizedReason: 'Para usar o app, autentique',
// stickyAuth: true,
// sensitiveTransaction: false);
// }
}
}