diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 376c8dab..eea2ce76 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -13,3 +13,4 @@ final DASHBOARD_DATA = 'dashboard-data'; final OTP_TYPE = 'otp-type'; final LAST_LOGIN_USER = 'last-login-user'; final PASSWORD = 'password'; +final CLINIC_NAME = 'clinic-name'; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 717dbaa6..30dc2700 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -58,6 +58,7 @@ class _DashboardScreenState extends State { DoctorProfileModel profile; bool isExpanded = false; String isInpatient = ""; + var clinicName = []; void didChangeDependencies() async { super.didChangeDependencies(); if (_isInit) { @@ -72,7 +73,8 @@ class _DashboardScreenState extends State { .listen((IosNotificationSettings settings) { print("Settings registered: $settings"); }); - + clinicName = await sharedPref.getObj(CLINIC_NAME); + print(clinicName); _firebaseMessaging.getToken().then((String token) async { if (token != '') { DEVICE_TOKEN = token; @@ -721,10 +723,7 @@ class _DashboardScreenState extends State { child: Column( children: [ AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[6]) - : "", + clinicName.length.toString(), fontSize: SizeConfig.textMultiplier * 6, color: Colors.white, ), diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index b5111704..04a82a80 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -486,7 +486,11 @@ class _VerificationMethodsState extends State { case 3: return InkWell( onTap: () => { - authenticateUser(3, BiometricType.fingerprint.index, authProv) + if (checkIfBiometricAvailable(BiometricType.fingerprint)) + { + authenticateUser( + 3, BiometricType.fingerprint.index, authProv) + } }, child: RoundedContainer( backgroundColor: @@ -518,8 +522,11 @@ class _VerificationMethodsState extends State { break; case 4: return InkWell( - onTap: () => - {authenticateUser(4, BiometricType.face.index, authProv)}, + onTap: () { + if (checkIfBiometricAvailable(BiometricType.face)) { + authenticateUser(4, BiometricType.face.index, authProv); + } + }, child: RoundedContainer( backgroundColor: checkIfBiometricAvailable(BiometricType.face) ? Colors.white @@ -739,7 +746,9 @@ class _VerificationMethodsState extends State { sharedPref.setString(TOKEN, res['AuthenticationTokenID']); if (res['List_DoctorProfile'] != null) { loginProcessCompleted(res['List_DoctorProfile'][0], authProv); + sharedPref.setObj(CLINIC_NAME, res['List_DoctorsClinic']); } else { + sharedPref.setObj(CLINIC_NAME, res['List_DoctorsClinic']); ClinicModel clinic = ClinicModel.fromJson(res['List_DoctorsClinic'][0]); getDocProfiles(clinic, authProv);