|
|
@ -31,6 +31,7 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
|
|
|
|
import 'package:local_auth/auth_strings.dart';
|
|
|
|
import 'package:local_auth/local_auth.dart';
|
|
|
|
import 'package:local_auth/local_auth.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
// import 'package:smart_progress_bar/smart_progress_bar.dart';
|
|
|
|
// import 'package:smart_progress_bar/smart_progress_bar.dart';
|
|
|
@ -383,10 +384,21 @@ class _ConfirmLogin extends State<ConfirmLogin> {
|
|
|
|
loginWithFingurePrintFace(type, isActive) async {
|
|
|
|
loginWithFingurePrintFace(type, isActive) async {
|
|
|
|
if (isActive == 1) {
|
|
|
|
if (isActive == 1) {
|
|
|
|
// this.startBiometricLoginIfAvailable();
|
|
|
|
// this.startBiometricLoginIfAvailable();
|
|
|
|
authenticated = await auth.authenticateWithBiometrics(
|
|
|
|
const iosStrings = const IOSAuthMessages(
|
|
|
|
localizedReason: 'Scan your fingerprint to authenticate',
|
|
|
|
cancelButton: 'cancel',
|
|
|
|
useErrorDialogs: true,
|
|
|
|
goToSettingsButton: 'settings',
|
|
|
|
stickyAuth: true);
|
|
|
|
goToSettingsDescription: 'Please set up your Touch ID.',
|
|
|
|
|
|
|
|
lockOut: 'Please reenable your Touch ID');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
authenticated = await auth.authenticateWithBiometrics(
|
|
|
|
|
|
|
|
localizedReason: 'Scan your fingerprint to authenticate',
|
|
|
|
|
|
|
|
useErrorDialogs: true,
|
|
|
|
|
|
|
|
stickyAuth: true,
|
|
|
|
|
|
|
|
iOSAuthStrings: iosStrings);
|
|
|
|
|
|
|
|
} on PlatformException catch (e) {
|
|
|
|
|
|
|
|
AppToast.showErrorToast(message: e.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (authenticated == true) {
|
|
|
|
if (authenticated == true) {
|
|
|
|
if (user != null && (user.logInType == 2 || user.logInType == 3)) {
|
|
|
|
if (user != null && (user.logInType == 2 || user.logInType == 3)) {
|
|
|
@ -530,6 +542,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
|
|
|
|
userData = result.list,
|
|
|
|
userData = result.list,
|
|
|
|
// sharedPref.setString(
|
|
|
|
// sharedPref.setString(
|
|
|
|
// BLOOD_TYPE, result['PatientBloodType']),
|
|
|
|
// BLOOD_TYPE, result['PatientBloodType']),
|
|
|
|
|
|
|
|
authenticatedUserObject.user = result.list,
|
|
|
|
sharedPref.setObject(MAIN_USER, result.list),
|
|
|
|
sharedPref.setObject(MAIN_USER, result.list),
|
|
|
|
sharedPref.setObject(USER_PROFILE, result.list),
|
|
|
|
sharedPref.setObject(USER_PROFILE, result.list),
|
|
|
|
loginTokenID = result.logInTokenID,
|
|
|
|
loginTokenID = result.logInTokenID,
|
|
|
|