Merge remote-tracking branch 'origin/master'

# Conflicts:
#	assets/langs/ar-SA.json
#	assets/langs/en-US.json
#	lib/generated/locale_keys.g.dart
calender_package
tahaalam 1 month ago
commit 2467ec1ce4

@ -181,6 +181,16 @@ class ApiClientImp implements ApiClient {
body[_appState.isAuthenticated ? 'TokenID' : 'LogInTokenID'] = _appState.appAuthToken; body[_appState.isAuthenticated ? 'TokenID' : 'LogInTokenID'] = _appState.appAuthToken;
} }
if (url.contains("HMGAI_Lab_Analyze_Orders_API")) {
url = "https://uat.hmgwebservices.com/Services/Patients.svc/REST/HMGAI_Lab_Analyze_Orders_API";
body['TokenID'] = "@dm!n";
}
if (url.contains("HMGAI_Lab_Analyzer_API")) {
url = "https://uat.hmgwebservices.com/Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API";
body['TokenID'] = "@dm!n";
}
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// body['PatientID'] = 4768663; // body['PatientID'] = 4768663;
// body['PatientTypeID'] = 1; // body['PatientTypeID'] = 1;

@ -908,7 +908,8 @@ class ApiConsts {
static String getAiOverViewLabOrder = "Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API"; static String getAiOverViewLabOrder = "Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API";
// ************ static values for Api **************** // ************ static values for Api ****************
static final double appVersionID = 19.7; // static final double appVersionID = 19.7;
static final double appVersionID = 50.7;
static final int appChannelId = 3; static final int appChannelId = 3;
static final String appIpAddress = "10.20.10.20"; static final String appIpAddress = "10.20.10.20";
static final String appGeneralId = "Cs2020@2016\$2958"; static final String appGeneralId = "Cs2020@2016\$2958";

@ -38,7 +38,7 @@ class LoadingUtils {
child: Material( child: Material(
child: Center( child: Center(
child: isSuccessDialog ? Utils.getSuccessWidget(loadingText: loadingText) : Utils.getLoadingWidget(loadingText: loadingText), child: isSuccessDialog ? Utils.getSuccessWidget(loadingText: loadingText) : Utils.getLoadingWidget(loadingText: loadingText),
), ).paddingSymmetrical(24.w, 0),
), ),
); );
}).then((value) { }).then((value) {

@ -423,11 +423,12 @@ extension DynamicTextStyleExtension on BuildContext {
Locale? locale, Locale? locale,
TextBaseline? textBaseline, TextBaseline? textBaseline,
FontStyle? fontStyle, FontStyle? fontStyle,
String? fontFamily,
bool isLanguageSwitcher = false}) { bool isLanguageSwitcher = false}) {
AppState appState = getIt.get<AppState>(); AppState appState = getIt.get<AppState>();
final family = appState.getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'; final family = appState.getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins';
return TextStyle( return TextStyle(
fontFamily: family, fontFamily: fontFamily ?? family,
fontSize: fontSize, fontSize: fontSize,
fontWeight: fontWeight, fontWeight: fontWeight,
color: color, color: color,

@ -584,8 +584,7 @@ class AuthenticationViewModel extends ChangeNotifier {
if (!_appState.getIsChildLoggedIn) { if (!_appState.getIsChildLoggedIn) {
await medicalVm.getFamilyFiles(status: 0); await medicalVm.getFamilyFiles(status: 0);
// await medicalVm.getAllPendingRecordsByResponseId(); // await medicalVm.getAllPendingRecordsByResponseId();
// _navigationService.replaceAllRoutesAndNavigateToLanding(); _navigationService.replaceAllRoutesAndNavigateToLanding();
_navigationService.popUntilNamed(AppRoutes.landingScreen);
} }
} else { } else {
if (activation.list != null && activation.list!.isNotEmpty) { if (activation.list != null && activation.list!.isNotEmpty) {
@ -745,7 +744,10 @@ class AuthenticationViewModel extends ChangeNotifier {
Future<void> onWrongActivationCode({String? message}) async { Future<void> onWrongActivationCode({String? message}) async {
otpScreenNotifier.value = true; otpScreenNotifier.value = true;
await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {}); await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {
LoaderBottomSheet.hideLoader();
_navigationService.pushAndReplace(AppRoutes.loginScreen);
});
} }
loginWithFingerPrintFace(Function success) async { loginWithFingerPrintFace(Function success) async {

@ -400,6 +400,10 @@ class LabViewModel extends ChangeNotifier {
lowRefenceValue = minY; lowRefenceValue = minY;
} }
if (minY > lowRefenceValue) {
minY = lowRefenceValue - 25;
}
this.flagForHighReferenceRange = flagForHighReferenceRange; this.flagForHighReferenceRange = flagForHighReferenceRange;
this.flagForLowReferenceRange = flagForLowReferenceRange; this.flagForLowReferenceRange = flagForLowReferenceRange;
highTransformedReferenceValue = double.parse(transformValueInRange(highRefrenceValue, flagForHighReferenceRange ?? "").toStringAsFixed(1)); highTransformedReferenceValue = double.parse(transformValueInRange(highRefrenceValue, flagForHighReferenceRange ?? "").toStringAsFixed(1));
@ -728,8 +732,9 @@ class LabViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
Future<void> getAiOverviewLabOrders({required PatientLabOrdersResponseModel labOrder}) async { Future<void> getAiOverviewLabOrders({required PatientLabOrdersResponseModel labOrder, required String loadingText}) async {
LoadingUtils.showFullScreenLoader(loadingText: "Loading and analysing your data,\nPlease be patient and let the AI do the magic"); // LoadingUtils.showFullScreenLoader(loadingText: "Loading and analysing your data,\nPlease be patient and let the AI do the magic. \nPlease be patient, This might take some time.");
LoadingUtils.showFullScreenLoader(loadingText: loadingText);
List<Map<String, dynamic>> results = []; List<Map<String, dynamic>> results = [];
Map<String, dynamic> orderData = {"order_date": labOrder.orderDate ?? "", "clinic": labOrder.clinicDescription ?? "", "doctor": labOrder.doctorName ?? "", "results": []}; Map<String, dynamic> orderData = {"order_date": labOrder.orderDate ?? "", "clinic": labOrder.clinicDescription ?? "", "doctor": labOrder.doctorName ?? "", "results": []};
List<Map<String, dynamic>> testResults = []; List<Map<String, dynamic>> testResults = [];
@ -769,8 +774,8 @@ class LabViewModel extends ChangeNotifier {
LoadingUtils.hideFullScreenLoader(); LoadingUtils.hideFullScreenLoader();
} }
Future<void> getAiOverviewSingleLabResult({required String langId, required LabResult recentLabResult}) async { Future<void> getAiOverviewSingleLabResult({required String langId, required LabResult recentLabResult, required String loadingText}) async {
LoaderBottomSheet.showLoader(); LoaderBottomSheet.showLoader(loadingText: loadingText);
List<Map<String, dynamic>> results = []; List<Map<String, dynamic>> results = [];
results.add({ results.add({
"Description": recentLabResult.description ?? '', "Description": recentLabResult.description ?? '',

@ -193,8 +193,8 @@ class PrescriptionsRepoImp implements PrescriptionsRepo {
"ProjectID": prescriptionsResponseModel.projectID, "ProjectID": prescriptionsResponseModel.projectID,
"DischargeNo": prescriptionsResponseModel.dischargeNo, "DischargeNo": prescriptionsResponseModel.dischargeNo,
"IsDownload": true, "IsDownload": true,
// "To": Utils.appState.getAuthenticatedUser()!.emailAddress, "To": Utils.appState.getAuthenticatedUser()!.emailAddress,
"To": "amjad.haroon@cloudsolutions.com.sa", // "To": "amjad.haroon@cloudsolutions.com.sa",
"ClinicName": prescriptionsResponseModel.clinicDescription, "ClinicName": prescriptionsResponseModel.clinicDescription,
"DoctorName": prescriptionsResponseModel.doctorName, "DoctorName": prescriptionsResponseModel.doctorName,
}; };

@ -54,7 +54,7 @@ class PrescriptionsViewModel extends ChangeNotifier {
PrescriptionsViewModel({required this.prescriptionsRepo, required this.errorHandlerService, required this.navServices}); PrescriptionsViewModel({required this.prescriptionsRepo, required this.errorHandlerService, required this.navServices});
initPrescriptionsViewModel() { initPrescriptionsViewModel() {
if (isPrescriptionsDataNeedsReloading) { // if (isPrescriptionsDataNeedsReloading) {
patientPrescriptionOrders.clear(); patientPrescriptionOrders.clear();
patientPrescriptionOrdersByClinic.clear(); patientPrescriptionOrdersByClinic.clear();
patientPrescriptionOrdersByHospital.clear(); patientPrescriptionOrdersByHospital.clear();
@ -62,7 +62,7 @@ class PrescriptionsViewModel extends ChangeNotifier {
prescriptionsOrderList.clear(); prescriptionsOrderList.clear();
isPrescriptionsOrdersLoading = true; isPrescriptionsOrdersLoading = true;
getPatientPrescriptionOrders(); getPatientPrescriptionOrders();
} // }
isSortByClinic = true; isSortByClinic = true;
isPrescriptionsDeliveryOrdersLoading = true; isPrescriptionsDeliveryOrdersLoading = true;
notifyListeners(); notifyListeners();
@ -102,9 +102,9 @@ class PrescriptionsViewModel extends ChangeNotifier {
} }
Future<void> getPatientPrescriptionOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientPrescriptionOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async {
if (!isPrescriptionsDataNeedsReloading) { // if (!isPrescriptionsDataNeedsReloading) {
return; // return;
} // }
final result = await prescriptionsRepo.getPatientPrescriptionOrders(patientId: "1231755"); final result = await prescriptionsRepo.getPatientPrescriptionOrders(patientId: "1231755");

@ -1513,8 +1513,6 @@ abstract class LocaleKeys {
static const trackerAndOthers = 'trackerAndOthers'; static const trackerAndOthers = 'trackerAndOthers';
static const bmi = 'bmi'; static const bmi = 'bmi';
static const yesPleaseINeedHelp = 'yesPleaseINeedHelp'; static const yesPleaseINeedHelp = 'yesPleaseINeedHelp';
static const noThanksIKnowTheClinic = 'noThanksIKnowTheClinic';
static const unableToSendOTP = 'unableToSendOTP';
static const aiOverView = 'aiOverView'; static const aiOverView = 'aiOverView';
static const generateAiAnalysis = 'generateAiAnalysis'; static const generateAiAnalysis = 'generateAiAnalysis';
static const aiAnalysis = 'aiAnalysis'; static const aiAnalysis = 'aiAnalysis';
@ -1562,19 +1560,8 @@ abstract class LocaleKeys {
static const servicePriceListRights = 'servicePriceListRights'; static const servicePriceListRights = 'servicePriceListRights';
static const serviceName = 'serviceName'; static const serviceName = 'serviceName';
static const noFreeSlot = 'noFreeSlot'; static const noFreeSlot = 'noFreeSlot';
static const applewatch = 'applewatch'; static const noThanksIKnowTheClinic = 'noThanksIKnowTheClinic';
static const applehealthapplicationshouldbeinstalledinyourphone = 'applehealthapplicationshouldbeinstalledinyourphone'; static const unableToSendOTP = 'unableToSendOTP';
static const unabletodetectapplicationinstalledpleasecomebackonceinstalled = 'unabletodetectapplicationinstalledpleasecomebackonceinstalled'; static const loadingAIAnalysis = 'loadingAIAnalysis';
static const applewatchshouldbeconnected = 'applewatchshouldbeconnected';
static const samsungwatch = 'samsungwatch';
static const samsunghealthapplicationshouldbeinstalledinyourphone = 'samsunghealthapplicationshouldbeinstalledinyourphone';
static const samsungwatchshouldbeconnected = 'samsungwatchshouldbeconnected';
static const huaweiwatch = 'huaweiwatch';
static const huaweihealthapplicationshouldbeinstalledinyourphone = 'huaweihealthapplicationshouldbeinstalledinyourphone';
static const huaweiwatchshouldbeconnected = 'huaweiwatchshouldbeconnected';
static const whoopwatch = 'whoopwatch';
static const whoophealthapplicationshouldbeinstalledinyourphone = 'whoophealthapplicationshouldbeinstalledinyourphone';
static const whoopwatchshouldbeconnected = 'whoopwatchshouldbeconnected';
static const updatetheinformation = 'updatetheinformation';
} }

@ -491,6 +491,7 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onSuccess: (apiResponse) { onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () { Future.delayed(Duration(milliseconds: 500), () {
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.initAppointmentsViewModel(); myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false); myAppointmentsViewModel.getPatientAppointments(true, false);
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
@ -511,6 +512,7 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!, isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
onSuccess: (apiResponse) { onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () { Future.delayed(Duration(milliseconds: 500), () {
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.initAppointmentsViewModel(); myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false); myAppointmentsViewModel.getPatientAppointments(true, false);
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();

@ -193,7 +193,7 @@ class AppointmentCard extends StatelessWidget {
? 'Cardiology'.toText10().toShimmer2(isShow: isLoading) ? 'Cardiology'.toText10().toShimmer2(isShow: isLoading)
: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}" : "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}"
.toText10(isEnglishOnly: true), .toText10(isEnglishOnly: true),
), ).toShimmer2(isShow: isLoading),
), ),
// AppCustomChipWidget( // AppCustomChipWidget(

@ -87,7 +87,10 @@ class HabibWalletCard extends StatelessWidget {
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
SizedBox(width: 8.h), SizedBox(width: 8.h),
habibWalletVM.habibWalletAmount.toString().toText32(isBold: true, isEnglishOnly: true).toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h), habibWalletVM.habibWalletAmount
.toString()
.toText32(isBold: true, isEnglishOnly: true)
.toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h),
], ],
); );
}), }),

@ -50,7 +50,7 @@ class LabResultByClinic extends StatelessWidget {
cancelLabel: LocaleKeys.rejectView.tr(), cancelLabel: LocaleKeys.rejectView.tr(),
onOkPressed: () { onOkPressed: () {
context.pop(); context.pop();
labViewModel.getAiOverviewLabOrders(labOrder: labOrder); labViewModel.getAiOverviewLabOrders(labOrder: labOrder, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
}, },
onCancelPressed: () { onCancelPressed: () {
context.pop(); context.pop();

@ -62,6 +62,7 @@ class AiAnalysisWidget extends StatelessWidget {
SizedBox(height: 20.h), SizedBox(height: 20.h),
], ],
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Icon(Icons.info_outline, color: AppColors.greyTextColor, size: 20.r), Icon(Icons.info_outline, color: AppColors.greyTextColor, size: 20.r),
SizedBox(width: 8.w), SizedBox(width: 8.w),

@ -11,6 +11,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'dart:ui' as ui;
class LabOrderResultItem extends StatelessWidget { class LabOrderResultItem extends StatelessWidget {
final VoidCallback onTap; final VoidCallback onTap;
@ -43,7 +44,9 @@ class LabOrderResultItem extends StatelessWidget {
), ),
(tests!.packageShortDescription ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight), (tests!.packageShortDescription ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
SizedBox(height: 12.h), SizedBox(height: 12.h),
Row( Directionality(
textDirection: ui.TextDirection.ltr,
child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
Flexible( Flexible(
@ -87,6 +90,7 @@ class LabOrderResultItem extends StatelessWidget {
) )
], ],
), ),
),
SizedBox(height: 12.h), SizedBox(height: 12.h),
Row( Row(

@ -45,7 +45,7 @@ class LabResultDetails extends StatelessWidget {
cancelLabel: LocaleKeys.rejectView.tr(), cancelLabel: LocaleKeys.rejectView.tr(),
onOkPressed: () { onOkPressed: () {
context.pop(); context.pop();
labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult); labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
}, },
onCancelPressed: () { onCancelPressed: () {
context.pop(); context.pop();

@ -341,7 +341,7 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
case 'high': case 'high':
return AppColors.primaryRedColor; return AppColors.primaryRedColor;
case 'medium' || 'moderate': case 'medium' || 'moderate':
return AppColors.lightGreenColor; return AppColors.textGreenColor;
case 'low': case 'low':
return AppColors.alertColor; return AppColors.alertColor;
default: default:
@ -361,7 +361,7 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
case 'L': // Low case 'L': // Low
case 'LL': // Very Low case 'LL': // Very Low
case 'CRITICAL LOW': case 'CRITICAL LOW':
return AppColors.chipColorSeekMedicalAdvice; return AppColors.chipColorSeekMedicalAdvice.withAlpha(75);
case 'N': // Normal case 'N': // Normal
return AppColors.lightGreenButtonColor; return AppColors.lightGreenButtonColor;
case 'A': // Abnormal case 'A': // Abnormal
@ -379,7 +379,7 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
case 'CRITICAL HIGH': case 'CRITICAL HIGH':
return AppColors.primaryRedColor; return AppColors.primaryRedColor;
case 'N': case 'N':
return AppColors.lightGreenColor; return AppColors.textGreenColor;
case 'L': // Low case 'L': // Low
case 'LL': // Very Low case 'LL': // Very Low
case 'CRITICAL LOW': case 'CRITICAL LOW':

@ -155,26 +155,26 @@ class PrescriptionItemView extends StatelessWidget {
], ],
).paddingSymmetrical(16.h, 0.h), ).paddingSymmetrical(16.h, 0.h),
SizedBox(height: 14.h), SizedBox(height: 14.h),
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
Row( // Row(
children: [ // children: [
Expanded( // Expanded(
child: CustomButton( // child: CustomButton(
text: LocaleKeys.checkAvailability.tr(context: context), // text: LocaleKeys.checkAvailability.tr(context: context),
onPressed: () {}, // onPressed: () {},
backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), // backgroundColor: AppColors.primaryRedColor.withOpacity(0.1),
borderColor: AppColors.primaryRedColor.withOpacity(0.0), // borderColor: AppColors.primaryRedColor.withOpacity(0.0),
textColor: AppColors.primaryRedColor, // textColor: AppColors.primaryRedColor,
fontSize: 14.f, // fontSize: 14.f,
fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
borderRadius: 12.r, // borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h, // height: 40.h,
).toShimmer2(isShow: isLoading), // ).toShimmer2(isShow: isLoading),
), // ),
// SizedBox(width: 16.h), // // SizedBox(width: 16.h),
], // ],
).paddingSymmetrical(16.h, 16.h), // ).paddingSymmetrical(16.h, 16.h),
], ],
), ),
); );

@ -205,7 +205,8 @@ class PossibleConditionsPage extends StatelessWidget {
final SymptomsCheckerViewModel symptomsCheckerViewModel = context.read<SymptomsCheckerViewModel>(); final SymptomsCheckerViewModel symptomsCheckerViewModel = context.read<SymptomsCheckerViewModel>();
symptomsCheckerViewModel.reset(); // Clear all symptoms checker data symptomsCheckerViewModel.reset(); // Clear all symptoms checker data
final navigationService = getIt.get<NavigationService>(); final navigationService = getIt.get<NavigationService>();
navigationService.replaceAllRoutesAndNavigateToLanding(); // navigationService.replaceAllRoutesAndNavigateToLanding();
navigationService.replaceAllRoutesAndNavigateToLandingAuth();
}, },
), ),
trailing: _buildTrailingSection(context), trailing: _buildTrailingSection(context),

@ -89,7 +89,8 @@ class _SymptomsSelectorPageState extends State<SymptomsSelectorPage> {
context.pop(); context.pop();
viewModel.reset(); // Clear all symptoms checker data viewModel.reset(); // Clear all symptoms checker data
final navigationService = getIt.get<NavigationService>(); final navigationService = getIt.get<NavigationService>();
navigationService.replaceAllRoutesAndNavigateToLanding(); // navigationService.replaceAllRoutesAndNavigateToLanding();
navigationService.replaceAllRoutesAndNavigateToLandingAuth();
}), }),
child: viewModel.isBodySymptomsLoading child: viewModel.isBodySymptomsLoading
? _buildLoadingShimmer() ? _buildLoadingShimmer()

@ -316,7 +316,8 @@ class _TriagePageState extends State<TriagePage> {
context.pop(); context.pop();
viewModel.reset(); // Clear all symptoms checker data viewModel.reset(); // Clear all symptoms checker data
final navigationService = getIt.get<NavigationService>(); final navigationService = getIt.get<NavigationService>();
navigationService.replaceAllRoutesAndNavigateToLanding(); // navigationService.replaceAllRoutesAndNavigateToLanding();
navigationService.replaceAllRoutesAndNavigateToLandingAuth();
}, },
), ),
callBackFunc: () {}, callBackFunc: () {},

@ -34,6 +34,13 @@ class NavigationService {
); );
} }
void replaceAllRoutesAndNavigateToLandingAuth() {
navigatorKey.currentState?.pushNamedAndRemoveUntil(
AppRoutes.landingScreen,
(Route<dynamic> route) => false,
);
}
void pushAndReplace(String routeName) { void pushAndReplace(String routeName) {
navigatorKey.currentState?.pushReplacementNamed(routeName); navigatorKey.currentState?.pushReplacementNamed(routeName);
} }

@ -4,9 +4,14 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/int_extensions.dart'; import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/emergency_services/emergency_services_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/todo_section/todo_section_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:provider/provider.dart';
class AppLanguageChange extends StatefulWidget { class AppLanguageChange extends StatefulWidget {
AppLanguageChange({Key? key}) : super(key: key); AppLanguageChange({Key? key}) : super(key: key);
@ -20,6 +25,11 @@ class AppLanguageChange extends StatefulWidget {
class _AppLanguageChangeState extends State<AppLanguageChange> { class _AppLanguageChangeState extends State<AppLanguageChange> {
String? selectedValue; String? selectedValue;
late MyAppointmentsViewModel myAppointmentsViewModel;
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
late EmergencyServicesViewModel emergencyServicesViewModel;
late TodoSectionViewModel todoSectionViewModel;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -33,6 +43,12 @@ class _AppLanguageChangeState extends State<AppLanguageChange> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
selectedValue ??= context.locale.languageCode; selectedValue ??= context.locale.languageCode;
myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false);
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
emergencyServicesViewModel = Provider.of<EmergencyServicesViewModel>(context, listen: false);
todoSectionViewModel = Provider.of<TodoSectionViewModel>(context, listen: false);
return Column( return Column(
spacing: 24.h, spacing: 24.h,
children: [ children: [
@ -51,6 +67,18 @@ class _AppLanguageChangeState extends State<AppLanguageChange> {
text: LocaleKeys.save.tr(context: context), text: LocaleKeys.save.tr(context: context),
onPressed: () { onPressed: () {
context.setLocale(selectedValue == 'en' ? Locale('en', 'US') : Locale('ar', 'SA')).then((val) { context.setLocale(selectedValue == 'en' ? Locale('en', 'US') : Locale('ar', 'SA')).then((val) {
//Reload My Appointments Data
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
//Reload Immediate LiveCare Data
immediateLiveCareViewModel.initImmediateLiveCare();
immediateLiveCareViewModel.getPatientLiveCareHistory();
//Reload Emergency Services Data
emergencyServicesViewModel.checkPatientERAdvanceBalance();
Navigator.pop(context); Navigator.pop(context);
}); });
}), }),

@ -310,7 +310,7 @@ class _ScrollAnimatedTitleState extends State<ScrollAnimatedTitle> {
child: Container( child: Container(
height: 40.h, height: 40.h,
padding: EdgeInsets.all(8.w), padding: EdgeInsets.all(8.w),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.transparent, borderRadius: 10.r, side: BorderSide(width: 1, color: AppColors.borderGrayColor)), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 8.r, side: BorderSide(width: 1, color: AppColors.borderGrayColor)),
child: ShaderMask( child: ShaderMask(
blendMode: BlendMode.srcIn, blendMode: BlendMode.srcIn,
shaderCallback: (bounds) => AppColors.aiLinearGradient.createShader(bounds), shaderCallback: (bounds) => AppColors.aiLinearGradient.createShader(bounds),
@ -326,7 +326,7 @@ class _ScrollAnimatedTitleState extends State<ScrollAnimatedTitle> {
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
letterSpacing: -0.4, letterSpacing: -0.4,
fontSize: (12 - (2 * (1 - t))).f, fontSize: (14 - (2 * (1 - t))).f,
fontWeight: FontWeight.lerp( fontWeight: FontWeight.lerp(
FontWeight.w400, FontWeight.w400,
FontWeight.w500, FontWeight.w500,

@ -59,14 +59,15 @@ class _LanguageSelectorState extends State<LanguageSelector> {
Utils.buildSvgWithAssets(icon: AppAssets.language), Utils.buildSvgWithAssets(icon: AppAssets.language),
SizedBox(width: 6.h), SizedBox(width: 6.h),
Text( Text(
currentLangData['name']?.toUpperCase() ?? 'EN', // currentLangData['name']?.toUpperCase() ?? 'EN',
widget.currentLanguage == 'ar' ? "ENGLISH" : "العربية",
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 14.f, fontSize: 14.f,
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
letterSpacing: 0.1, letterSpacing: 0.1,
isLanguageSwitcher: true, isLanguageSwitcher: true,
), fontFamily: widget.currentLanguage == 'ar' ? "Poppins" : "GESSTwo"),
), ),
], ],
), ),

@ -3,7 +3,9 @@ import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart';
class LoaderBottomSheet { class LoaderBottomSheet {
@ -31,7 +33,7 @@ class LoaderBottomSheet {
), ),
child: Center( child: Center(
child: Utils.getLoadingWidget(loadingText: loadingText), child: Utils.getLoadingWidget(loadingText: loadingText),
), ).paddingSymmetrical(24.w, 0),
); );
}, },
).whenComplete(() { ).whenComplete(() {

Loading…
Cancel
Save