diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 63d36252..5fb73a37 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -4,7 +4,7 @@ import 'package:hmg_patient_app_new/core/enums.dart'; class ApiConsts { static const maxSmallScreen = 660; - static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; + static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; // 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 6072e8b9..8d313774 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -31,6 +31,7 @@ import 'package:hmg_patient_app_new/features/authentication/models/resp_models/s import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart'; import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/authentication/login.dart'; import 'package:hmg_patient_app_new/presentation/authentication/saved_login_screen.dart'; @@ -131,6 +132,8 @@ class AuthenticationViewModel extends ChangeNotifier { pickedCountryByUAEUser = null; _appState.setUserRegistrationPayload = RegistrationDataModelPayload(); _appState.setNHICUserData = CheckUserStatusResponseNHIC(); + getIt.get().setSelectedHeight(0); + getIt.get().setSelectedWeight(0); } void onCountryChange(CountryEnum country) { diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index 2d077b5f..9d36d5df 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -546,6 +546,9 @@ class BookAppointmentsViewModel extends ChangeNotifier { //TODO: Make the API dynamic with parameters for ProjectID, isNearest, languageID, doctorId, doctorName Future getDoctorsList({int projectID = 0, bool isNearest = true, int doctorId = 0, String doctorName = "", Function(dynamic)? onSuccess, Function(String)? onError}) async { doctorsList.clear(); + filteredDoctorList.clear(); + doctorsListGrouped.clear(); + notifyListeners(); projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID; final result = await bookAppointmentsRepo.getDoctorsList(selectedClinic.clinicID ?? 0, projectID, doctorName.isNotEmpty ? false : isNearest, doctorId, doctorName, isContinueDentalPlan: isContinueDentalPlan); diff --git a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart index 2b3a6ffc..ef80ec7b 100644 --- a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart +++ b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart @@ -117,38 +117,38 @@ class _RegionBottomSheetBodyState extends State { height: MediaQuery.of(context).size.height * 0.5, child: Column( children: [ - Consumer( - builder: (context, regionVM, _) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 8.h), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Utils.buildSvgWithAssets(icon: AppAssets.location, iconColor: AppColors.greyTextColor, width: 24.h, height: 24.h), - SizedBox(width: 12.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.sortByLocation.tr(context: context).toText14(isBold: true), - // SizedBox(height: 4.h), - LocaleKeys.sortByNearestLocation.tr(context: context).toText11(color: AppColors.textColorLight, weight: FontWeight.w500), - ], - ), - ], - ), - Switch( - value: regionVM.sortByLocation, - onChanged: (value) => _handleSortByLocationToggle(value), - activeThumbColor: AppColors.successColor, - activeTrackColor: AppColors.successColor.withValues(alpha: 0.15), - ), - ], - ), - ); - }, - ), + // Consumer( + // builder: (context, regionVM, _) { + // return Padding( + // padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 8.h), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Row( + // children: [ + // Utils.buildSvgWithAssets(icon: AppAssets.location, iconColor: AppColors.greyTextColor, width: 24.h, height: 24.h), + // SizedBox(width: 12.w), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // LocaleKeys.sortByLocation.tr(context: context).toText14(isBold: true), + // // SizedBox(height: 4.h), + // LocaleKeys.sortByNearestLocation.tr(context: context).toText11(color: AppColors.textColorLight, weight: FontWeight.w500), + // ], + // ), + // ], + // ), + // Switch( + // value: regionVM.sortByLocation, + // onChanged: (value) => _handleSortByLocationToggle(value), + // activeThumbColor: AppColors.successColor, + // activeTrackColor: AppColors.successColor.withValues(alpha: 0.15), + // ), + // ], + // ), + // ); + // }, + // ), Expanded( child: ListView.separated( itemCount: myAppointmentsVM.hospitalList?.registeredDoctorMap?.length ?? 0, diff --git a/lib/presentation/book_appointment/select_doctor_page.dart b/lib/presentation/book_appointment/select_doctor_page.dart index 7947fa05..4e56b083 100644 --- a/lib/presentation/book_appointment/select_doctor_page.dart +++ b/lib/presentation/book_appointment/select_doctor_page.dart @@ -220,8 +220,9 @@ class _SelectDoctorPageState extends State { ], ).paddingSymmetrical(0.h, 0.h), if (bookAppointmentsViewModel.isGetDocForHealthCal && bookAppointmentsVM.showSortFilterButtons) SizedBox(height: 16.h), - Row( - mainAxisSize: MainAxisSize.max, + bookAppointmentsVM.doctorsListGrouped.isNotEmpty + ? Row( + mainAxisSize: MainAxisSize.max, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -241,8 +242,9 @@ class _SelectDoctorPageState extends State { }, ), ], - ), - ListView.separated( + ) + : SizedBox.shrink(), + ListView.separated( padding: EdgeInsets.only(top: 16.h), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), diff --git a/lib/presentation/book_appointment/widgets/doctor_card.dart b/lib/presentation/book_appointment/widgets/doctor_card.dart index 4cf883e1..307b73ad 100644 --- a/lib/presentation/book_appointment/widgets/doctor_card.dart +++ b/lib/presentation/book_appointment/widgets/doctor_card.dart @@ -133,9 +133,9 @@ class DoctorCard extends StatelessWidget { labelText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)), // richText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)) // .toText10(isEnglishOnly: true, color: AppColors.textColor), - // backgroundColor: AppColors.successColor, - isEnglishOnly: true, - textColor: AppColors.textColor, + backgroundColor: AppColors.successColor.withValues(alpha: .15), + isEnglishOnly: true, + textColor: AppColors.successColor, ).toShimmer2(isShow: isLoading) : SizedBox.shrink() : SizedBox.shrink(), diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index f4cc5ac8..bce87ca2 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -234,8 +234,8 @@ class _LandingPageState extends State { mainAxisSize: MainAxisSize.min, spacing: 18.h, children: [ - Stack(children: [ - if (appState.isAuthenticated) + Stack(clipBehavior: Clip.none, children: [ + if (appState.isAuthenticated) Utils.buildSvgWithAssets(icon: AppAssets.bell, height: 24.h, width: 24.h).onPress(() async { if (appState.isAuthenticated) { notificationsViewModel.setNotificationStatusID(2); @@ -252,22 +252,22 @@ class _LandingPageState extends State { }), (appState.isAuthenticated && (int.parse(todoSectionVM.notificationsCount ?? "0") > 0)) ? Positioned( - right: 0, - top: 0, + right: appState.isArabic() ? 8.w : -8.w, + top: -8.h, + // left: 4.h, + // bottom: 4.h, child: Container( - width: 8.w, - height: 8.h, - padding: EdgeInsets.all(4), + width: 18.w, + height: 18.h, + padding: EdgeInsets.all(2), decoration: BoxDecoration( color: AppColors.primaryRedColor, borderRadius: BorderRadius.circular(20.r), ), child: Text( - "", + todoSectionVM.notificationsCount.toString(), style: TextStyle( - color: Colors.white, - fontSize: 8.f, - ), + color: Colors.white, fontFamily: "Poppins", fontSize: 10.f, fontWeight: FontWeight.w500), textAlign: TextAlign.center, ), ), diff --git a/lib/presentation/home/service_info_page.dart b/lib/presentation/home/service_info_page.dart index bf21577a..5b6b0f34 100644 --- a/lib/presentation/home/service_info_page.dart +++ b/lib/presentation/home/service_info_page.dart @@ -23,51 +23,67 @@ class ServiceInfoPage extends StatelessWidget { @override Widget build(BuildContext context) { - return CollapsingListView( - title: "", - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + return Scaffold( + backgroundColor: AppColors.bgScaffoldColor, + body: Column( children: [ - AppCustomChipWidget( - richText: serviceName.toText14(color: AppColors.infoColor, weight: FontWeight.w500), - backgroundColor: AppColors.infoColor.withAlpha(50), - textColor: AppColors.infoColor, - ).paddingSymmetrical(24.h, 0.h), - SizedBox(height: 24.h), - serviceHeader.toText28(isBold: true, height: 1.4).paddingSymmetrical(24.h, 0.h), - SizedBox(height: 24.h), - serviceDescription.toText14(weight: FontWeight.w500, color: AppColors.greyTextColor).paddingSymmetrical(24.h, 0.h), - SizedBox(height: 24.h), - CustomButton( - text: LocaleKeys.login.tr(context: context), - onPressed: () { - getIt().onLoginPressed(); - }, - backgroundColor: AppColors.secondaryLightRedColor, - borderColor: AppColors.secondaryLightRedColor, - textColor: AppColors.primaryRedColor, - fontSize: 16.f, - fontWeight: FontWeight.w500, - borderRadius: 12.r, - padding: EdgeInsets.symmetric(horizontal: 10.w), - height: 40.h, - icon: AppAssets.login1, - iconColor: AppColors.primaryRedColor, - iconSize: 18.h, - ).paddingSymmetrical(24.h, 0.h), - SizedBox(height: 36.h), - ClipRRect( - borderRadius: BorderRadius.circular(24.r), - child: Transform.flip( - flipX: getIt.get().isArabic(), - child: Image.asset( - serviceImage, - fit: BoxFit.fitHeight, - height: 480.h, - width: 520.w, + Expanded( + child: CollapsingListView( + title: "", + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(24.r), + child: Transform.flip( + flipX: getIt.get().isArabic(), + child: Image.asset( + serviceImage, + fit: BoxFit.fitHeight, + // height: 480.h, + // width: 520.w, + ), + ), + ).paddingSymmetrical(24.h, 0.h), + SizedBox(height: 32.h), + AppCustomChipWidget( + richText: serviceName.toText14(color: AppColors.infoColor, weight: FontWeight.w500), + backgroundColor: AppColors.infoColor.withAlpha(50), + textColor: AppColors.infoColor, + ).paddingSymmetrical(24.h, 0.h), + SizedBox(height: 24.h), + serviceHeader.toText28(isBold: true, height: 1.4).paddingSymmetrical(24.h, 0.h), + SizedBox(height: 24.h), + serviceDescription.toText14(weight: FontWeight.w500, color: AppColors.greyTextColor).paddingSymmetrical(24.h, 0.h), + SizedBox(height: 24.h), + ], ), ), ), + Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 24.r, + hasShadow: true, + ), + child: CustomButton( + text: LocaleKeys.login.tr(context: context), + onPressed: () { + getIt().onLoginPressed(); + }, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.primaryRedColor, + textColor: AppColors.whiteColor, + fontSize: 16.f, + fontWeight: FontWeight.w500, + borderRadius: 12.r, + padding: EdgeInsets.symmetric(horizontal: 10.w), + height: 56.h, + icon: AppAssets.login1, + iconColor: AppColors.whiteColor, + iconSize: 18.h, + ).paddingSymmetrical(24.h, 24.h), + ) ], ), ); diff --git a/lib/presentation/my_invoices/widgets/invoice_list_card.dart b/lib/presentation/my_invoices/widgets/invoice_list_card.dart index e5ae7de8..a45dfdd8 100644 --- a/lib/presentation/my_invoices/widgets/invoice_list_card.dart +++ b/lib/presentation/my_invoices/widgets/invoice_list_card.dart @@ -94,7 +94,7 @@ class InvoiceListCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - (getIt().isArabic() ? getInvoicesListResponseModel.doctorNameN! : getInvoicesListResponseModel.doctorName!).toText16(isBold: true), + (getIt().isArabic() ? getInvoicesListResponseModel.doctorNameN! : getInvoicesListResponseModel.doctorName ?? "HMG Doctor").toText16(isBold: true), SizedBox(height: 8.h), Wrap( direction: Axis.horizontal, diff --git a/lib/presentation/notifications/notifications_list_page.dart b/lib/presentation/notifications/notifications_list_page.dart index 6c4e7279..bc90b4aa 100644 --- a/lib/presentation/notifications/notifications_list_page.dart +++ b/lib/presentation/notifications/notifications_list_page.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; +import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; @@ -9,6 +10,7 @@ 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/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/notifications/notifications_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/presentation/lab/lab_result_item_view.dart'; import 'package:hmg_patient_app_new/presentation/notifications/notification_details_page.dart'; @@ -79,7 +81,8 @@ class _NotificationsListPageState extends State { child: GestureDetector( onTap: () { notificationsVM.markAsRead(notificationID: notificationsVM.notificationsList[index].id ?? 0); - Navigator.push( + getIt.get().getPatientDashboard(); + Navigator.push( context, MaterialPageRoute( builder: (context) => NotificationDetailsPage( diff --git a/lib/presentation/symptoms_checker/user_info_selection.dart b/lib/presentation/symptoms_checker/user_info_selection.dart index b245c014..8d58e049 100644 --- a/lib/presentation/symptoms_checker/user_info_selection.dart +++ b/lib/presentation/symptoms_checker/user_info_selection.dart @@ -175,9 +175,13 @@ class _UserInfoSelectionPageState extends State { int? displayAge = viewModel.selectedAge ?? userAgeFromDOB; String ageText = displayAge != null ? "$displayAge ${LocaleKeys.years.tr(context: context)}" : LocaleKeys.notSet.tr(context: context); - String heightText = viewModel.selectedHeight != null ? "${viewModel.selectedHeight!.round()} ${viewModel.isHeightCm ? 'cm' : 'ft'}" : LocaleKeys.notSet.tr(context: context); + String heightText = (viewModel.selectedHeight != null && viewModel.selectedHeight != 0) + ? "${viewModel.selectedHeight!.round()} ${viewModel.isHeightCm ? 'cm' : 'ft'}" + : LocaleKeys.notSet.tr(context: context); - String weightText = viewModel.selectedWeight != null ? "${viewModel.selectedWeight!.round()} ${viewModel.isWeightKg ? 'kg' : 'lbs'}" : LocaleKeys.notSet.tr(context: context); + String weightText = (viewModel.selectedWeight != null && viewModel.selectedWeight != 0) + ? "${viewModel.selectedWeight!.round()} ${viewModel.isWeightKg ? 'kg' : 'lbs'}" + : LocaleKeys.notSet.tr(context: context); return Column( children: [ diff --git a/lib/presentation/symptoms_checker/user_info_selection/widgets/custom_date_picker.dart b/lib/presentation/symptoms_checker/user_info_selection/widgets/custom_date_picker.dart index 98051e04..d2b82ef5 100644 --- a/lib/presentation/symptoms_checker/user_info_selection/widgets/custom_date_picker.dart +++ b/lib/presentation/symptoms_checker/user_info_selection/widgets/custom_date_picker.dart @@ -149,6 +149,7 @@ class _ThreeColumnDatePickerState extends State { fontWeight: selected ? FontWeight.w600 : FontWeight.w500, color: selected ? AppColors.textColor : AppColors.greyTextColor.withValues(alpha: 0.9), height: 1.0, + fontFamily: "Poppins", letterSpacing: selected ? -0.02 * 30 : -0.02 * 18, ), );