pull/208/head
haroon amjad 6 days ago
parent 3703afe8bd
commit f7446d0d41

@ -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.uat; static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT

@ -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/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/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/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/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/authentication/login.dart'; import 'package:hmg_patient_app_new/presentation/authentication/login.dart';
import 'package:hmg_patient_app_new/presentation/authentication/saved_login_screen.dart'; import 'package:hmg_patient_app_new/presentation/authentication/saved_login_screen.dart';
@ -131,6 +132,8 @@ class AuthenticationViewModel extends ChangeNotifier {
pickedCountryByUAEUser = null; pickedCountryByUAEUser = null;
_appState.setUserRegistrationPayload = RegistrationDataModelPayload(); _appState.setUserRegistrationPayload = RegistrationDataModelPayload();
_appState.setNHICUserData = CheckUserStatusResponseNHIC(); _appState.setNHICUserData = CheckUserStatusResponseNHIC();
getIt.get<SymptomsCheckerViewModel>().setSelectedHeight(0);
getIt.get<SymptomsCheckerViewModel>().setSelectedWeight(0);
} }
void onCountryChange(CountryEnum country) { void onCountryChange(CountryEnum country) {

@ -546,6 +546,9 @@ class BookAppointmentsViewModel extends ChangeNotifier {
//TODO: Make the API dynamic with parameters for ProjectID, isNearest, languageID, doctorId, doctorName //TODO: Make the API dynamic with parameters for ProjectID, isNearest, languageID, doctorId, doctorName
Future<void> getDoctorsList({int projectID = 0, bool isNearest = true, int doctorId = 0, String doctorName = "", Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getDoctorsList({int projectID = 0, bool isNearest = true, int doctorId = 0, String doctorName = "", Function(dynamic)? onSuccess, Function(String)? onError}) async {
doctorsList.clear(); doctorsList.clear();
filteredDoctorList.clear();
doctorsListGrouped.clear();
notifyListeners();
projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID; projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID;
final result = final result =
await bookAppointmentsRepo.getDoctorsList(selectedClinic.clinicID ?? 0, projectID, doctorName.isNotEmpty ? false : isNearest, doctorId, doctorName, isContinueDentalPlan: isContinueDentalPlan); await bookAppointmentsRepo.getDoctorsList(selectedClinic.clinicID ?? 0, projectID, doctorName.isNotEmpty ? false : isNearest, doctorId, doctorName, isContinueDentalPlan: isContinueDentalPlan);

@ -117,38 +117,38 @@ class _RegionBottomSheetBodyState extends State<RegionBottomSheetBody> {
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context).size.height * 0.5,
child: Column( child: Column(
children: [ children: [
Consumer<AppointmentViaRegionViewmodel>( // Consumer<AppointmentViaRegionViewmodel>(
builder: (context, regionVM, _) { // builder: (context, regionVM, _) {
return Padding( // return Padding(
padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 8.h), // padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 8.h),
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
Row( // Row(
children: [ // children: [
Utils.buildSvgWithAssets(icon: AppAssets.location, iconColor: AppColors.greyTextColor, width: 24.h, height: 24.h), // Utils.buildSvgWithAssets(icon: AppAssets.location, iconColor: AppColors.greyTextColor, width: 24.h, height: 24.h),
SizedBox(width: 12.w), // SizedBox(width: 12.w),
Column( // Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
LocaleKeys.sortByLocation.tr(context: context).toText14(isBold: true), // LocaleKeys.sortByLocation.tr(context: context).toText14(isBold: true),
// SizedBox(height: 4.h), // // SizedBox(height: 4.h),
LocaleKeys.sortByNearestLocation.tr(context: context).toText11(color: AppColors.textColorLight, weight: FontWeight.w500), // LocaleKeys.sortByNearestLocation.tr(context: context).toText11(color: AppColors.textColorLight, weight: FontWeight.w500),
], // ],
), // ),
], // ],
), // ),
Switch( // Switch(
value: regionVM.sortByLocation, // value: regionVM.sortByLocation,
onChanged: (value) => _handleSortByLocationToggle(value), // onChanged: (value) => _handleSortByLocationToggle(value),
activeThumbColor: AppColors.successColor, // activeThumbColor: AppColors.successColor,
activeTrackColor: AppColors.successColor.withValues(alpha: 0.15), // activeTrackColor: AppColors.successColor.withValues(alpha: 0.15),
), // ),
], // ],
), // ),
); // );
}, // },
), // ),
Expanded( Expanded(
child: ListView.separated( child: ListView.separated(
itemCount: myAppointmentsVM.hospitalList?.registeredDoctorMap?.length ?? 0, itemCount: myAppointmentsVM.hospitalList?.registeredDoctorMap?.length ?? 0,

@ -220,8 +220,9 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
], ],
).paddingSymmetrical(0.h, 0.h), ).paddingSymmetrical(0.h, 0.h),
if (bookAppointmentsViewModel.isGetDocForHealthCal && bookAppointmentsVM.showSortFilterButtons) SizedBox(height: 16.h), if (bookAppointmentsViewModel.isGetDocForHealthCal && bookAppointmentsVM.showSortFilterButtons) SizedBox(height: 16.h),
Row( bookAppointmentsVM.doctorsListGrouped.isNotEmpty
mainAxisSize: MainAxisSize.max, ? Row(
mainAxisSize: MainAxisSize.max,
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -241,8 +242,9 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
}, },
), ),
], ],
), )
ListView.separated( : SizedBox.shrink(),
ListView.separated(
padding: EdgeInsets.only(top: 16.h), padding: EdgeInsets.only(top: 16.h),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),

@ -133,9 +133,9 @@ class DoctorCard extends StatelessWidget {
labelText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)), labelText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)),
// richText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)) // richText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot))
// .toText10(isEnglishOnly: true, color: AppColors.textColor), // .toText10(isEnglishOnly: true, color: AppColors.textColor),
// backgroundColor: AppColors.successColor, backgroundColor: AppColors.successColor.withValues(alpha: .15),
isEnglishOnly: true, isEnglishOnly: true,
textColor: AppColors.textColor, textColor: AppColors.successColor,
).toShimmer2(isShow: isLoading) ).toShimmer2(isShow: isLoading)
: SizedBox.shrink() : SizedBox.shrink()
: SizedBox.shrink(), : SizedBox.shrink(),

@ -234,8 +234,8 @@ class _LandingPageState extends State<LandingPage> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
spacing: 18.h, spacing: 18.h,
children: [ children: [
Stack(children: [ Stack(clipBehavior: Clip.none, children: [
if (appState.isAuthenticated) if (appState.isAuthenticated)
Utils.buildSvgWithAssets(icon: AppAssets.bell, height: 24.h, width: 24.h).onPress(() async { Utils.buildSvgWithAssets(icon: AppAssets.bell, height: 24.h, width: 24.h).onPress(() async {
if (appState.isAuthenticated) { if (appState.isAuthenticated) {
notificationsViewModel.setNotificationStatusID(2); notificationsViewModel.setNotificationStatusID(2);
@ -252,22 +252,22 @@ class _LandingPageState extends State<LandingPage> {
}), }),
(appState.isAuthenticated && (int.parse(todoSectionVM.notificationsCount ?? "0") > 0)) (appState.isAuthenticated && (int.parse(todoSectionVM.notificationsCount ?? "0") > 0))
? Positioned( ? Positioned(
right: 0, right: appState.isArabic() ? 8.w : -8.w,
top: 0, top: -8.h,
// left: 4.h,
// bottom: 4.h,
child: Container( child: Container(
width: 8.w, width: 18.w,
height: 8.h, height: 18.h,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(2),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
), ),
child: Text( child: Text(
"", todoSectionVM.notificationsCount.toString(),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white, fontFamily: "Poppins", fontSize: 10.f, fontWeight: FontWeight.w500),
fontSize: 8.f,
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),

@ -23,51 +23,67 @@ class ServiceInfoPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CollapsingListView( return Scaffold(
title: "", backgroundColor: AppColors.bgScaffoldColor,
child: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppCustomChipWidget( Expanded(
richText: serviceName.toText14(color: AppColors.infoColor, weight: FontWeight.w500), child: CollapsingListView(
backgroundColor: AppColors.infoColor.withAlpha(50), title: "",
textColor: AppColors.infoColor, child: Column(
).paddingSymmetrical(24.h, 0.h), crossAxisAlignment: CrossAxisAlignment.start,
SizedBox(height: 24.h), children: [
serviceHeader.toText28(isBold: true, height: 1.4).paddingSymmetrical(24.h, 0.h), ClipRRect(
SizedBox(height: 24.h), borderRadius: BorderRadius.circular(24.r),
serviceDescription.toText14(weight: FontWeight.w500, color: AppColors.greyTextColor).paddingSymmetrical(24.h, 0.h), child: Transform.flip(
SizedBox(height: 24.h), flipX: getIt.get<AppState>().isArabic(),
CustomButton( child: Image.asset(
text: LocaleKeys.login.tr(context: context), serviceImage,
onPressed: () { fit: BoxFit.fitHeight,
getIt<AuthenticationViewModel>().onLoginPressed(); // height: 480.h,
}, // width: 520.w,
backgroundColor: AppColors.secondaryLightRedColor, ),
borderColor: AppColors.secondaryLightRedColor, ),
textColor: AppColors.primaryRedColor, ).paddingSymmetrical(24.h, 0.h),
fontSize: 16.f, SizedBox(height: 32.h),
fontWeight: FontWeight.w500, AppCustomChipWidget(
borderRadius: 12.r, richText: serviceName.toText14(color: AppColors.infoColor, weight: FontWeight.w500),
padding: EdgeInsets.symmetric(horizontal: 10.w), backgroundColor: AppColors.infoColor.withAlpha(50),
height: 40.h, textColor: AppColors.infoColor,
icon: AppAssets.login1, ).paddingSymmetrical(24.h, 0.h),
iconColor: AppColors.primaryRedColor, SizedBox(height: 24.h),
iconSize: 18.h, serviceHeader.toText28(isBold: true, height: 1.4).paddingSymmetrical(24.h, 0.h),
).paddingSymmetrical(24.h, 0.h), SizedBox(height: 24.h),
SizedBox(height: 36.h), serviceDescription.toText14(weight: FontWeight.w500, color: AppColors.greyTextColor).paddingSymmetrical(24.h, 0.h),
ClipRRect( SizedBox(height: 24.h),
borderRadius: BorderRadius.circular(24.r), ],
child: Transform.flip(
flipX: getIt.get<AppState>().isArabic(),
child: Image.asset(
serviceImage,
fit: BoxFit.fitHeight,
height: 480.h,
width: 520.w,
), ),
), ),
), ),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.r,
hasShadow: true,
),
child: CustomButton(
text: LocaleKeys.login.tr(context: context),
onPressed: () {
getIt<AuthenticationViewModel>().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),
)
], ],
), ),
); );

@ -94,7 +94,7 @@ class InvoiceListCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(getIt<AppState>().isArabic() ? getInvoicesListResponseModel.doctorNameN! : getInvoicesListResponseModel.doctorName!).toText16(isBold: true), (getIt<AppState>().isArabic() ? getInvoicesListResponseModel.doctorNameN! : getInvoicesListResponseModel.doctorName ?? "HMG Doctor").toText16(isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Wrap( Wrap(
direction: Axis.horizontal, direction: Axis.horizontal,

@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.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/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/date_util.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';
@ -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/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/notifications/notifications_view_model.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/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/lab/lab_result_item_view.dart';
import 'package:hmg_patient_app_new/presentation/notifications/notification_details_page.dart'; import 'package:hmg_patient_app_new/presentation/notifications/notification_details_page.dart';
@ -79,7 +81,8 @@ class _NotificationsListPageState extends State<NotificationsListPage> {
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
notificationsVM.markAsRead(notificationID: notificationsVM.notificationsList[index].id ?? 0); notificationsVM.markAsRead(notificationID: notificationsVM.notificationsList[index].id ?? 0);
Navigator.push( getIt.get<TodoSectionViewModel>().getPatientDashboard();
Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => NotificationDetailsPage( builder: (context) => NotificationDetailsPage(

@ -175,9 +175,13 @@ class _UserInfoSelectionPageState extends State<UserInfoSelectionPage> {
int? displayAge = viewModel.selectedAge ?? userAgeFromDOB; int? displayAge = viewModel.selectedAge ?? userAgeFromDOB;
String ageText = displayAge != null ? "$displayAge ${LocaleKeys.years.tr(context: context)}" : LocaleKeys.notSet.tr(context: context); 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( return Column(
children: [ children: [

@ -149,6 +149,7 @@ class _ThreeColumnDatePickerState extends State<ThreeColumnDatePicker> {
fontWeight: selected ? FontWeight.w600 : FontWeight.w500, fontWeight: selected ? FontWeight.w600 : FontWeight.w500,
color: selected ? AppColors.textColor : AppColors.greyTextColor.withValues(alpha: 0.9), color: selected ? AppColors.textColor : AppColors.greyTextColor.withValues(alpha: 0.9),
height: 1.0, height: 1.0,
fontFamily: "Poppins",
letterSpacing: selected ? -0.02 * 30 : -0.02 * 18, letterSpacing: selected ? -0.02 * 30 : -0.02 * 18,
), ),
); );

Loading…
Cancel
Save