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
This commit is contained in:
Matthew Fosse
2024-04-18 19:00:24 +02:00
committed by GitHub
parent 59d44e8c57
commit e6b4b08c24
21 changed files with 642 additions and 481 deletions
+7 -8
View File
@@ -1,5 +1,6 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_local_authentication/flutter_local_authentication.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/view_model/auth_state.dart';
@@ -105,16 +106,14 @@ abstract class AuthViewModelBase with Store {
@action
Future<void> biometricAuth() async {
final _flutterLocalAuthenticationPlugin = FlutterLocalAuthentication();
try {
final canBiometricAuth = await _biometricAuth.canCheckBiometrics();
if (canBiometricAuth) {
final isAuthenticated = await _biometricAuth.isAuthenticated();
if (isAuthenticated) {
state = ExecutedSuccessfullyState();
}
final authenticated = await _flutterLocalAuthenticationPlugin.authenticate();
if (!authenticated) {
throw Exception('Biometric authentication failed');
}
state = ExecutedSuccessfullyState();
} catch (e) {
state = FailureState(e.toString());
}