From c191fd0be1114308a8c8a86c22248c6685faa8eb Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 17 Sep 2025 18:59:44 +0300 Subject: [PATCH] updates --- lib/core/api_consts.dart | 2 +- lib/features/authentication/authentication_view_model.dart | 7 ++++--- .../authentication/widgets/otp_verification_screen.dart | 6 ++++++ lib/presentation/home/landing_page.dart | 1 + lib/presentation/home/navigation_screen.dart | 4 ++-- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index d31679c..f802818 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -723,7 +723,7 @@ const DEACTIVATE_ACCOUNT = 'Services/Patients.svc/REST/PatientAppleActivation_In class ApiConsts { static const maxSmallScreen = 660; - static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; + static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index cd550c7..b860c7b 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -363,7 +363,7 @@ class AuthenticationViewModel extends ChangeNotifier { ); // TODO: GET APP SMS SIGNATURE HERE - request.sMSSignature =await getSignature(); + request.sMSSignature = await getSignature(); if (checkIsUserComingForRegister(request: payload)) { _appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload); @@ -617,8 +617,8 @@ class AuthenticationViewModel extends ChangeNotifier { } else { // authenticated = true; await insertPatientIMEIData(loginTypeEnum.toInt); + LoaderBottomSheet.hideLoader(); } - LoaderBottomSheet.hideLoader(); notifyListeners(); // navigateToHomeScreen(); } else { @@ -873,6 +873,7 @@ class AuthenticationViewModel extends ChangeNotifier { getDeviceLastLogin = deviceInfo.first['LoginType']; await checkActivationCode(otpTypeEnum: OTPTypeEnum.faceIDFingerprint, activationCode: null, onWrongActivationCode: (String? message) {}); await insertPatientIMEIData(loginTypeEnum.toInt); + LoaderBottomSheet.hideLoader(); } if (apiResponse.messageStatus == 2) { LoaderBottomSheet.hideLoader(); @@ -937,6 +938,7 @@ class AuthenticationViewModel extends ChangeNotifier { }, ); } + Future getSignature() async { if (Platform.isAndroid) { return await SmsVerification.getAppSignature(); @@ -944,5 +946,4 @@ class AuthenticationViewModel extends ChangeNotifier { return null; } } - } diff --git a/lib/features/authentication/widgets/otp_verification_screen.dart b/lib/features/authentication/widgets/otp_verification_screen.dart index 6d66061..c6f1069 100644 --- a/lib/features/authentication/widgets/otp_verification_screen.dart +++ b/lib/features/authentication/widgets/otp_verification_screen.dart @@ -5,9 +5,12 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; +import 'package:get_it/get_it.dart'; +import 'package:hmg_patient_app_new/core/cache_consts.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart'; +import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart'; import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart'; @@ -95,6 +98,8 @@ class OTPWidgetState extends State with SingleTickerProviderStateMixi bool hasFocus = false; AuthenticationViewModel? authVm; + final CacheService cacheService = GetIt.instance(); + @override void didUpdateWidget(OTPWidget oldWidget) { super.didUpdateWidget(oldWidget); @@ -138,6 +143,7 @@ class OTPWidgetState extends State with SingleTickerProviderStateMixi } focusNode.addListener(_focusListener); authVm?.otpScreenNotifier.addListener(_onOtpScreenNotifierChanged); + cacheService.remove(key: CacheConst.quickLoginEnabled); } void _controllerListener() { diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 2d40869..9f8ae79 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -93,6 +93,7 @@ class _LandingPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + appState.isAuthenticated ? WelcomeWidget( onTap: () { diff --git a/lib/presentation/home/navigation_screen.dart b/lib/presentation/home/navigation_screen.dart index 981363e..8feeb5f 100644 --- a/lib/presentation/home/navigation_screen.dart +++ b/lib/presentation/home/navigation_screen.dart @@ -27,10 +27,10 @@ class _LandingNavigationState extends State { physics: const NeverScrollableScrollPhysics(), children: [ const LandingPage(), - appState.isAuthenticated ? MedicalFilePage() :/* need add feedback page */ const LandingPage(), + appState.isAuthenticated ? MedicalFilePage() : /* need add feedback page */ const LandingPage(), BookAppointmentPage(), const LandingPage(), - appState.isAuthenticated ? /* need add news page */ LandingPage() : const LandingPage(), + appState.isAuthenticated ? /* need add news page */ LandingPage() : const LandingPage(), ], ), bottomNavigationBar: BottomNavigation(