fix: erro na validação de biometria quando o usuário fechava o modal de leitura biométrica

This commit is contained in:
J. A. Messias 2024-11-06 16:27:49 -03:00
parent 568df2830f
commit 786f7df7dd
1 changed files with 3 additions and 2 deletions

View File

@ -324,8 +324,9 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget> with TickerProvider
Future<void> _showBiometricsAuth(BuildContext context) async {
await BiometricHelper.checkBiometrics()
.then((value) async => await BiometricHelper.authenticateBiometric().then((value) async {
final key =
await StorageHelper().get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage) ?? '';
if (value == false) throw Exception('Biometric authentication failed');
final key = await StorageHelper().get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage);
if (key == null || key.isEmpty) throw Exception('No key found');
safeSetState(() {
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop();