|
|
|
|
@ -10,7 +10,8 @@ import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:local_auth_android/local_auth_android.dart';
|
|
|
|
|
import 'package:local_auth_ios/local_auth_ios.dart';
|
|
|
|
|
import '../common_widgets/default_app_bar.dart';
|
|
|
|
|
|
|
|
|
|
class SettingsPage extends StatefulWidget {
|
|
|
|
|
@ -44,8 +45,15 @@ class _SettingsPageState extends State<SettingsPage> {
|
|
|
|
|
|
|
|
|
|
void checkForLocalAuth(bool buttonState) async {
|
|
|
|
|
bool authStatus = await _settingProvider.auth.authenticate(
|
|
|
|
|
localizedReason: Platform.isAndroid ? "Scan your fingerprint to authenticate" : "",
|
|
|
|
|
options: AuthenticationOptions(biometricOnly: Platform.isAndroid),
|
|
|
|
|
localizedReason: Platform.isAndroid ? "Scan your fingerprint to authenticate" : "Scan with face id to authenticate",
|
|
|
|
|
options: AuthenticationOptions(biometricOnly: Platform.isAndroid),
|
|
|
|
|
authMessages: [
|
|
|
|
|
IOSAuthMessages(
|
|
|
|
|
cancelButton: 'cancel',
|
|
|
|
|
goToSettingsButton: 'settings',
|
|
|
|
|
goToSettingsDescription: 'Please enable Touch ID.',
|
|
|
|
|
lockOut: 'Please reenable your Touch ID')
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
if (authStatus) {
|
|
|
|
|
localAuth = !localAuth;
|
|
|
|
|
|