pull/206/head
haroon amjad 3 days ago
parent edeae70aa0
commit 3703afe8bd

@ -301,7 +301,7 @@
"vitalSignsSubTitle": "التقارير", "vitalSignsSubTitle": "التقارير",
"myMedical": "نشط", "myMedical": "نشط",
"myMedicalSubtitle": "الأدوية", "myMedicalSubtitle": "الأدوية",
"myDoctor": "طبيبي", "myDoctor": "أطبائي",
"myDoctorSubtitle": "القائمة", "myDoctorSubtitle": "القائمة",
"eye": "العين", "eye": "العين",
"eyeSubtitle": "القياس", "eyeSubtitle": "القياس",
@ -1646,6 +1646,7 @@
"later": "لاحقاً", "later": "لاحقاً",
"cancelAppointmentConfirmMessage": "هل أنت متأكد من رغبتك في إلغاء هذا الموعد؟", "cancelAppointmentConfirmMessage": "هل أنت متأكد من رغبتك في إلغاء هذا الموعد؟",
"acknowledged": "معترف به", "acknowledged": "معترف به",
"searchLabResults": "بحث نتائج المختبر" "searchLabResults": "بحث نتائج المختبر",
"callForAssistance": "اتصل للحصول على المساعدة الفورية"
} }

@ -300,7 +300,7 @@
"vitalSignsSubTitle": "Reports", "vitalSignsSubTitle": "Reports",
"myMedical": "Active", "myMedical": "Active",
"myMedicalSubtitle": "Medications", "myMedicalSubtitle": "Medications",
"myDoctor": "My Doctor", "myDoctor": "My Doctors",
"myDoctorSubtitle": "List", "myDoctorSubtitle": "List",
"eye": "Eye", "eye": "Eye",
"eyeSubtitle": "Measurement", "eyeSubtitle": "Measurement",
@ -1638,5 +1638,6 @@
"later": "Later", "later": "Later",
"cancelAppointmentConfirmMessage": "Are you sure you want to cancel this appointment?", "cancelAppointmentConfirmMessage": "Are you sure you want to cancel this appointment?",
"acknowledged": "Acknowledged", "acknowledged": "Acknowledged",
"searchLabResults": "Search lab results" "searchLabResults": "Search lab results",
"callForAssistance": "Call for immediate assistance"
} }

@ -4,7 +4,7 @@ import 'package:hmg_patient_app_new/core/enums.dart';
class ApiConsts { class ApiConsts {
static const maxSmallScreen = 660; 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 // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT

@ -15,37 +15,37 @@ class LoadingUtils {
static bool get isLoading => _isLoadingVisible; static bool get isLoading => _isLoadingVisible;
static showFullScreenLoader({bool barrierDismissible = true, isSuccessDialog = false, String loadingText = "Loading, Please wait..."}) { // static showFullScreenLoader({bool barrierDismissible = true, isSuccessDialog = false, String loadingText = "Loading, Please wait..."}) {
if (!_isLoadingVisible) { // if (!_isLoadingVisible) {
_isLoadingVisible = true; // _isLoadingVisible = true;
final context = _navigationService.navigatorKey.currentContext; // final context = _navigationService.navigatorKey.currentContext;
log("got the context in showFullScreenLoading"); // log("got the context in showFullScreenLoading");
if (context == null) return; // if (context == null) return;
//
showDialog( // showDialog(
barrierDismissible: barrierDismissible, // barrierDismissible: barrierDismissible,
context: context, // context: context,
barrierColor: AppColors.blackColor.withOpacity(0.5), // barrierColor: AppColors.blackColor.withOpacity(0.5),
useRootNavigator: false, // useRootNavigator: false,
useSafeArea: false, // useSafeArea: false,
builder: (BuildContext context) { // builder: (BuildContext context) {
return Container( // return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( // decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, // color: AppColors.whiteColor,
borderRadius: 20.h, // borderRadius: 20.h,
hasShadow: false, // hasShadow: false,
), // ),
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), // ).paddingSymmetrical(24.w, 0),
), // ),
); // );
}).then((value) { // }).then((value) {
_isLoadingVisible = false; // _isLoadingVisible = false;
}); // });
} // }
} // }
static hideFullScreenLoader() { static hideFullScreenLoader() {
if (!_isLoadingVisible) return; if (!_isLoadingVisible) return;

@ -303,10 +303,11 @@ extension EmailValidator on String {
height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.f, letterSpacing: letterSpacing ?? -1, fontWeight: isBold ? FontWeight.bold : fontWeight ?? FontWeight.normal), height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.f, letterSpacing: letterSpacing ?? -1, fontWeight: isBold ? FontWeight.bold : fontWeight ?? FontWeight.normal),
); );
Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing}) => Text( Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing, bool isEnglishOnly = false,}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle( style: TextStyle(
fontFamily: (isEnglishOnly ? "Poppins" : getIt.get<AppState>().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'),
height: height ?? 23 / 26, color: color ?? AppColors.blackColor, fontSize: 26.f, letterSpacing: letterSpacing ?? -1, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)), height: height ?? 23 / 26, color: color ?? AppColors.blackColor, fontSize: 26.f, letterSpacing: letterSpacing ?? -1, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)),
); );

@ -862,17 +862,17 @@ class AuthenticationViewModel extends ChangeNotifier {
resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async { resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async {
if (apiResponse.data is String) { if (apiResponse.data is String) {
//TODO: This Section Need to Be Testing. //TODO: This Section Need to Be Testing.
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
_dialogService.showExceptionBottomSheet(message: apiResponse.data, onOkPressed: () {}, onCancelPressed: () {}); _dialogService.showExceptionBottomSheet(message: apiResponse.data, onOkPressed: () {}, onCancelPressed: () {});
//TODO: Here We Need to Show a Dialog Of Something in the case of Fail With OK and Cancel and the Display Variable WIll be result. //TODO: Here We Need to Show a Dialog Of Something in the case of Fail With OK and Cancel and the Display Variable WIll be result.
} else { } else {
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
if (apiResponse.data["MessageStatus"] == 1) { if (apiResponse.data["MessageStatus"] == 1) {
LoadingUtils.showFullScreenLoader(isSuccessDialog: true, loadingText: "Your medical file has been created successfully. \nPlease proceed to login."); LoaderBottomSheet.showLoader(loadingText: "Your medical file has been created successfully. \nPlease proceed to login.");
//TODO: Here We Need to Show a Dialog Of Something in the case of Success. //TODO: Here We Need to Show a Dialog Of Something in the case of Success.
await clearDefaultInputValues(); // This will Clear All Default Values Of User. await clearDefaultInputValues(); // This will Clear All Default Values Of User.
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
// _navigationService.pushAndReplace(AppRoutes.loginScreen); // _navigationService.pushAndReplace(AppRoutes.loginScreen);
_navigationService.pushAndRemoveUntil(CustomPageRoute(page: LandingNavigation()), (r) => false); _navigationService.pushAndRemoveUntil(CustomPageRoute(page: LandingNavigation()), (r) => false);
_navigationService.push(CustomPageRoute(page: LoginScreen())); _navigationService.push(CustomPageRoute(page: LoginScreen()));

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/location_util.dart'; import 'package:hmg_patient_app_new/core/location_util.dart';
@ -11,6 +12,7 @@ import 'package:hmg_patient_app_new/core/utils/loading_utils.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.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/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/features/book_appointments/book_appointments_repo.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/LaserCategoryType.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/LaserCategoryType.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/free_slot.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/free_slot.dart';
@ -879,30 +881,35 @@ class BookAppointmentsViewModel extends ChangeNotifier {
); );
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async { await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
LoaderBottomSheet.hideLoader(); // LoaderBottomSheet.hideLoader();
Future.delayed(Duration(milliseconds: 50)).then((value) async {}); Future.delayed(Duration(milliseconds: 50)).then((value) async {});
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr()); // LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingYourAppointment.tr());
await insertSpecificAppointment( await insertSpecificAppointment(
onError: (err) {}, onError: (err) {},
onSuccess: (apiResp) async { onSuccess: (apiResp) async {
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
await Future.delayed(Duration(milliseconds: 50)).then((value) async { await Future.delayed(Duration(milliseconds: 50)).then((value) async {
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); showCommonBottomSheetWithoutHeight(
await Future.delayed(Duration(milliseconds: 4000)).then((value) { GetIt.instance<NavigationService>().navigatorKey.currentContext!,
child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h),
callBackFunc: () {
setIsPatientRescheduleAppointment(false); setIsPatientRescheduleAppointment(false);
LoadingUtils.hideFullScreenLoader();
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
navigationService.navigatorKey.currentContext!, navigationService.navigatorKey.currentContext!,
CustomPageRoute( CustomPageRoute(
page: LandingNavigation(), page: LandingNavigation(),
), ),
(r) => false); (r) => false);
}); },
isFullScreen: false,
isCloseButtonVisible: false,
isAutoDismiss: true
);
}); });
}); });
}); });
} else { } else {
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
navigationService.navigatorKey.currentContext!, navigationService.navigatorKey.currentContext!,
@ -933,22 +940,28 @@ class BookAppointmentsViewModel extends ChangeNotifier {
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async { await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
Future.delayed(Duration(milliseconds: 50)).then((value) async {}); Future.delayed(Duration(milliseconds: 50)).then((value) async {});
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr()); LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingYourAppointment.tr());
await insertSpecificAppointment( await insertSpecificAppointment(
onError: (err) {}, onError: (err) {},
onSuccess: (apiResp) async { onSuccess: (apiResp) async {
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
await Future.delayed(Duration(milliseconds: 50)).then((value) async { await Future.delayed(Duration(milliseconds: 50)).then((value) async {
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); showCommonBottomSheetWithoutHeight(
await Future.delayed(Duration(milliseconds: 4000)).then((value) { GetIt.instance<NavigationService>().navigatorKey.currentContext!,
LoadingUtils.hideFullScreenLoader(); child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h),
callBackFunc: () {
setIsPatientRescheduleAppointment(false);
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
navigationService.navigatorKey.currentContext!, navigationService.navigatorKey.currentContext!,
CustomPageRoute( CustomPageRoute(
page: LandingNavigation(), page: LandingNavigation(),
), ),
(r) => false); (r) => false);
}); },
isFullScreen: false,
isCloseButtonVisible: false,
isAutoDismiss: true
);
}); });
}); });
}); });
@ -994,7 +1007,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// onError!(apiResponse); // onError!(apiResponse);
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
navigationService.navigatorKey.currentContext!, navigationService.navigatorKey.currentContext!,
@ -1030,22 +1043,28 @@ class BookAppointmentsViewModel extends ChangeNotifier {
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async { await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
navigationService.pop(); navigationService.pop();
Future.delayed(Duration(milliseconds: 50)).then((value) async {}); Future.delayed(Duration(milliseconds: 50)).then((value) async {});
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr()); LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingYourAppointment.tr());
await insertSpecificAppointment( await insertSpecificAppointment(
onError: (err) {}, onError: (err) {},
onSuccess: (apiResp) async { onSuccess: (apiResp) async {
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
await Future.delayed(Duration(milliseconds: 50)).then((value) async { await Future.delayed(Duration(milliseconds: 50)).then((value) async {
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); showCommonBottomSheetWithoutHeight(
await Future.delayed(Duration(milliseconds: 4000)).then((value) { GetIt.instance<NavigationService>().navigatorKey.currentContext!,
LoadingUtils.hideFullScreenLoader(); child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h),
callBackFunc: () {
setIsPatientRescheduleAppointment(false);
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
navigationService.navigatorKey.currentContext!, navigationService.navigatorKey.currentContext!,
CustomPageRoute( CustomPageRoute(
page: LandingNavigation(), page: LandingNavigation(),
), ),
(r) => false); (r) => false);
}); },
isFullScreen: false,
isCloseButtonVisible: false,
isAutoDismiss: true
);
}); });
}); });
}); });
@ -1539,7 +1558,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
}, },
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
navigationService.navigatorKey.currentContext!, navigationService.navigatorKey.currentContext!,

@ -1639,5 +1639,6 @@ abstract class LocaleKeys {
static const cancelAppointmentConfirmMessage = 'cancelAppointmentConfirmMessage'; static const cancelAppointmentConfirmMessage = 'cancelAppointmentConfirmMessage';
static const acknowledged = 'acknowledged'; static const acknowledged = 'acknowledged';
static const searchLabResults = 'searchLabResults'; static const searchLabResults = 'searchLabResults';
static const callForAssistance = 'callForAssistance';
} }

@ -218,7 +218,16 @@ class _MyDoctorsPageState extends State<MyDoctorsPage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppCustomChipWidget(labelText: "${group.length} ${'doctors'}"), AppCustomChipWidget(
richText: Row(
children: [
"${group.length} ".toText10(isEnglishOnly: true),
"${LocaleKeys.doctors.tr(context: context)} ".toText10()
],
),
// labelText: "${group.length} ${'doctors'}",
isEnglishOnly: true,
),
Icon(isExpanded ? Icons.expand_less : Icons.expand_more), Icon(isExpanded ? Icons.expand_less : Icons.expand_more),
], ],
), ),
@ -289,10 +298,10 @@ class _MyDoctorsPageState extends State<MyDoctorsPage> {
flex: 2, flex: 2,
child: CustomButton( child: CustomButton(
icon: AppAssets.view_report_icon, icon: AppAssets.view_report_icon,
iconColor: AppColors.primaryRedColor, iconColor: doctor?.isActiveDoctorProfile == false ? AppColors.inputLabelTextColor.withValues(alpha: 1.0) : AppColors.primaryRedColor,
iconSize: 16.h, iconSize: 16.h,
text: LocaleKeys.viewProfile.tr(context: context), text: LocaleKeys.viewProfile.tr(context: context),
onPressed: () async { onPressed: doctor?.isActiveDoctorProfile == false ? () {} : () async {
bookAppointmentsViewModel.setSelectedDoctor(DoctorsListResponseModel( bookAppointmentsViewModel.setSelectedDoctor(DoctorsListResponseModel(
clinicID: doctor?.clinicID ?? 0, clinicID: doctor?.clinicID ?? 0,
projectID: doctor?.projectID ?? 0, projectID: doctor?.projectID ?? 0,
@ -323,10 +332,9 @@ class _MyDoctorsPageState extends State<MyDoctorsPage> {
); );
}); });
}, },
isDisabled: doctor?.isActiveDoctorProfile == false, backgroundColor: doctor?.isActiveDoctorProfile == false ? AppColors.inputLabelTextColor.withValues(alpha: 0.3) : AppColors.secondaryLightRedColor,
backgroundColor: AppColors.secondaryLightRedColor, borderColor: doctor?.isActiveDoctorProfile == false ? AppColors.inputLabelTextColor.withValues(alpha: 0.01) : AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor, textColor: doctor?.isActiveDoctorProfile == false ? AppColors.inputLabelTextColor.withValues(alpha: 1.0) : AppColors.primaryRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, borderRadius: 12,

@ -84,7 +84,7 @@ class _SavedLogin extends State<SavedLogin> {
SizedBox(height: 16.h), SizedBox(height: 16.h),
appState.getSelectDeviceByImeiRespModelElement != null appState.getSelectDeviceByImeiRespModelElement != null
? appState.getSelectDeviceByImeiRespModelElement!.name!.toCamelCase ? appState.getSelectDeviceByImeiRespModelElement!.name!.toCamelCase
.toText26(isBold: true, height: 26 / 36, color: AppColors.textColor) .toText26(isBold: true, height: 26 / 36, color: AppColors.textColor, isEnglishOnly: true)
: SizedBox(), : SizedBox(),
SizedBox(height: 24.h), SizedBox(height: 24.h),
Container( Container(

@ -316,19 +316,23 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
} }
void initiateBookAppointment() async { void initiateBookAppointment() async {
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment ? LocaleKeys.reschedulingAppo.tr(context: context) : LocaleKeys.bookingYourAppointment.tr(context: context)); // LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment ? LocaleKeys.reschedulingAppo.tr(context: context) : LocaleKeys.bookingYourAppointment.tr(context: context));
LoaderBottomSheet.showLoader(loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment ? LocaleKeys.reschedulingAppo.tr(context: context) : LocaleKeys.bookingYourAppointment.tr(context: context));
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
if (bookAppointmentsViewModel.isLiveCareSchedule) { if (bookAppointmentsViewModel.isLiveCareSchedule) {
await bookAppointmentsViewModel.insertSpecificAppointmentForLiveCare(onError: (err) { await bookAppointmentsViewModel.insertSpecificAppointmentForLiveCare(onError: (err) {
print(err.data["ErrorEndUserMessage"]); print(err.data["ErrorEndUserMessage"]);
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
}, onSuccess: (apiResp) async { }, onSuccess: (apiResp) async {
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
await Future.delayed(Duration(milliseconds: 50)).then((value) async { await Future.delayed(Duration(milliseconds: 50)).then((value) async {
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); // LoaderBottomSheet.showLoader(loadingText: LocaleKeys.appointmentSuccess.tr());
await Future.delayed(Duration(milliseconds: 4000)).then((value) { showCommonBottomSheetWithoutHeight(
LoadingUtils.hideFullScreenLoader(); context,
child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()),
callBackFunc: () {
bookAppointmentsViewModel.setIsPatientRescheduleAppointment(false);
bookAppointmentsViewModel.setIsLiveCareSchedule(false); bookAppointmentsViewModel.setIsLiveCareSchedule(false);
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
@ -336,14 +340,18 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
page: LandingNavigation(), page: LandingNavigation(),
), ),
(r) => false); (r) => false);
}); },
isFullScreen: false,
isCloseButtonVisible: false,
isAutoDismiss: true
);
}); });
}); });
} else { } else {
//TODO: Add patient Derma package check API Here //TODO: Add patient Derma package check API Here
await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) { await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) {
// print(err.data["ErrorEndUserMessage"]); // print(err.data["ErrorEndUserMessage"]);
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: context), title: LocaleKeys.notice.tr(context: context),
context, context,
@ -357,19 +365,25 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
isCloseButtonVisible: true, isCloseButtonVisible: true,
); );
}, onSuccess: (apiResp) async { }, onSuccess: (apiResp) async {
LoadingUtils.hideFullScreenLoader(); LoaderBottomSheet.hideLoader();
await Future.delayed(Duration(milliseconds: 50)).then((value) async { await Future.delayed(Duration(milliseconds: 50)).then((value) async {
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); showCommonBottomSheetWithoutHeight(
await Future.delayed(Duration(milliseconds: 4000)).then((value) { context,
LoadingUtils.hideFullScreenLoader(); child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h),
callBackFunc: () {
bookAppointmentsViewModel.setIsLiveCareSchedule(false); bookAppointmentsViewModel.setIsLiveCareSchedule(false);
bookAppointmentsViewModel.setIsPatientRescheduleAppointment(false);
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
CustomPageRoute( CustomPageRoute(
page: LandingNavigation(), page: LandingNavigation(),
), ),
(r) => false); (r) => false);
}); },
isFullScreen: false,
isCloseButtonVisible: false,
isAutoDismiss: true
);
}); });
}); });
} }

@ -39,8 +39,8 @@ class ContactUs extends StatelessWidget {
checkInOptionCard( checkInOptionCard(
AppAssets.call_fill, AppAssets.call_fill,
LocaleKeys.callNow.tr(), LocaleKeys.callNow.tr(),
// LocaleKeys.viewNearestHMGLocationsviewNearestHMGLocations.tr(), LocaleKeys.callForAssistance.tr(),
"Call for immediate assistance", // "Call for immediate assistance",
).onPress(() { ).onPress(() {
launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); launchUrl(Uri.parse("tel://" + "+966 92 006 6666"));
}), }),

@ -1,6 +1,8 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.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/presentation/home/data/service_card_data.dart'; import 'package:hmg_patient_app_new/presentation/home/data/service_card_data.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
@ -123,8 +125,8 @@ class LandingPageData {
ServiceCardData( ServiceCardData(
serviceName: "my_doctors", serviceName: "my_doctors",
icon: AppAssets.my_doctors_icon, icon: AppAssets.my_doctors_icon,
title: "My", title: getIt.get<AppState>().isArabic() ? LocaleKeys.myDoctor : "My",
subtitle: "Doctors", subtitle: getIt.get<AppState>().isArabic() ? "" : "Doctors",
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
iconColor: AppColors.blackColor, iconColor: AppColors.blackColor,
textColor: AppColors.blackColor, textColor: AppColors.blackColor,

@ -43,7 +43,11 @@ class WelcomeWidget extends StatelessWidget {
children: [ children: [
Icon(Icons.menu, color: AppColors.textColor).onPress(() { Icon(Icons.menu, color: AppColors.textColor).onPress(() {
getIt.get<ProfileSettingsViewModel>().getProfileSettings(); getIt.get<ProfileSettingsViewModel>().getProfileSettings();
Navigator.of(context).push(springPageRoute(ProfileSettings())); Navigator.of(context).push(
CustomPageRoute(
page: ProfileSettings(),
),
);
}), }),
Image.asset(imageUrl, width: 40, height: 40), Image.asset(imageUrl, width: 40, height: 40),
Column( Column(

@ -159,7 +159,6 @@ class _AlphabetScrollPageState extends State<AlphabeticScroll> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children:List.generate(widget.alpahbetsAvailable.length, (i) { children:List.generate(widget.alpahbetsAvailable.length, (i) {
final isActive = (i == _activeIndex); final isActive = (i == _activeIndex);
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
setState(() => _activeIndex = i); setState(() => _activeIndex = i);
@ -175,7 +174,7 @@ class _AlphabetScrollPageState extends State<AlphabeticScroll> {
child: Opacity( child: Opacity(
opacity: isActive ? 1.0 : 0.5, opacity: isActive ? 1.0 : 0.5,
child: widget.alpahbetsAvailable[i].toUpperCase().toText14( child: widget.alpahbetsAvailable[i].toUpperCase().toText14(
color: !isActive ? AppColors.greyTextColor : AppColors.primaryRedColor color: !isActive ? AppColors.greyTextColor : AppColors.primaryRedColor, isEnglishOnly: true
), ),
), ),
); );

@ -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:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'dart:ui' as ui;
class LabOrderByTest extends StatelessWidget { class LabOrderByTest extends StatelessWidget {
final VoidCallback onTap; final VoidCallback onTap;
@ -36,7 +37,7 @@ class LabOrderByTest extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
'${tests!.description}'.toText16(isBold: true), '${tests!.description}'.toText16(isBold: true, isEnglishOnly: true),
SizedBox(height: 4.h), SizedBox(height: 4.h),
(appState.isArabic() ? tests!.testDescriptionAr : tests!.testDescriptionEn)!.toText12(fontWeight: FontWeight.w500), (appState.isArabic() ? tests!.testDescriptionAr : tests!.testDescriptionEn)!.toText12(fontWeight: FontWeight.w500),
SizedBox(height: 8.h), SizedBox(height: 8.h),
@ -44,7 +45,13 @@ class LabOrderByTest extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
richText: '${"${LocaleKeys.lastTested.tr(context: context)}:"} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(tests!.createdOn), false)}'.toText12(fontWeight: FontWeight.w500), richText: Row(
children: [
"${LocaleKeys.lastTested.tr(context: context)}: ".toText12(fontWeight: FontWeight.w500),
Directionality(
textDirection: ui.TextDirection.ltr,child: DateUtil.formatDateToDate(DateUtil.convertStringToDate(tests!.createdOn), false).toText12(fontWeight: FontWeight.w500, isEnglishOnly: true))
],
),
backgroundColor: AppColors.greyLightColor, backgroundColor: AppColors.greyLightColor,
textColor: AppColors.textColor, textColor: AppColors.textColor,
), ),

@ -132,6 +132,7 @@ class DialogServiceImp implements DialogService {
cancelLabel: cancelLabel, cancelLabel: cancelLabel,
onOkPressed: onOkPressed, onOkPressed: onOkPressed,
onCancelPressed: onCancelPressed, onCancelPressed: onCancelPressed,
isConfirmButton: isConfirmButton
), ),
callBackFunc: () {}, callBackFunc: () {},
); );
@ -266,7 +267,7 @@ Widget exceptionBottomSheetWidget({required BuildContext context, required Strin
child: CustomButton( child: CustomButton(
text: okLabel ?? LocaleKeys.confirm.tr(context: context), text: okLabel ?? LocaleKeys.confirm.tr(context: context),
onPressed: onOkPressed, onPressed: onOkPressed,
backgroundColor: isConfirmButton ? AppColors.successColor : AppColors.bgGreenColor, backgroundColor: AppColors.bgGreenColor,
borderColor: AppColors.successColor, borderColor: AppColors.successColor,
textColor: Colors.white, textColor: Colors.white,
icon: AppAssets.confirm, icon: AppAssets.confirm,
@ -284,8 +285,9 @@ Widget exceptionBottomSheetWidget({required BuildContext context, required Strin
context.pop(); context.pop();
} }
: onCancelPressed, : onCancelPressed,
backgroundColor: AppColors.primaryRedColor, // backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedBorderColor, backgroundColor: isConfirmButton ? AppColors.successColor : AppColors.primaryRedColor,
borderColor: isConfirmButton ? AppColors.successColor : AppColors.primaryRedColor,
textColor: Colors.white, textColor: Colors.white,
icon: AppAssets.confirm, icon: AppAssets.confirm,
), ),

@ -10,7 +10,6 @@ class CustomPageRoute<T> extends PageRouteBuilder<T> {
CustomPageRoute({required this.page, this.direction = AxisDirection.right, this.fullScreenDialog = false, super.settings}) CustomPageRoute({required this.page, this.direction = AxisDirection.right, this.fullScreenDialog = false, super.settings})
: super( : super(
transitionDuration: const Duration(milliseconds: 1500), transitionDuration: const Duration(milliseconds: 1500),
reverseTransitionDuration: const Duration(milliseconds: 500), reverseTransitionDuration: const Duration(milliseconds: 500),
fullscreenDialog: fullScreenDialog, fullscreenDialog: fullScreenDialog,

Loading…
Cancel
Save