Merge pull request 'haroon_dev' (#228) from haroon_dev into master

Reviewed-on: https://34.17.182.140/Haroon6138/HMG_Patient_App_New/pulls/228
master
Haroon6138 2 days ago
commit 46f9d38dcc

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@ -400,6 +400,7 @@ class AppAssets {
static const String fullBodyFrontFemale = '$pngBasePath/full_body_front_female.png'; static const String fullBodyFrontFemale = '$pngBasePath/full_body_front_female.png';
static const String fullBodyBackFemale = '$pngBasePath/full_body_back_female.png'; static const String fullBodyBackFemale = '$pngBasePath/full_body_back_female.png';
static const String bmiFullBody = '$pngBasePath/bmi_image_1.png'; static const String bmiFullBody = '$pngBasePath/bmi_image_1.png';
static const String defaultMEP = '$pngBasePath/default_MEP.png';
} }
class AppAnimations { class AppAnimations {

@ -923,7 +923,8 @@ class Utils {
), ),
TextSpan( TextSpan(
// text: NumberFormat.currency(locale: 'en_US', symbol: " ", decimalDigits: 0).format(habibWalletAmount), // text: NumberFormat.currency(locale: 'en_US', symbol: " ", decimalDigits: 0).format(habibWalletAmount),
text: " ${habibWalletAmount.toStringAsFixed(2)}", // text: " ${(NumberFormat.decimalPattern().format(habibWalletAmount)).toStringAsFixed(2)}",
text: " ${(NumberFormat.decimalPattern().format(habibWalletAmount))}",
style: TextStyle( style: TextStyle(
color: resolvedTextColor, color: resolvedTextColor,
fontSize: fontSize ?? 32.f, fontSize: fontSize ?? 32.f,

@ -1,11 +1,14 @@
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/enums.dart'; import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/doctor_response_mapper.dart'; import 'package:hmg_patient_app_new/core/utils/doctor_response_mapper.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/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/blood_donation/blood_donation_repo.dart'; import 'package:hmg_patient_app_new/features/blood_donation/blood_donation_repo.dart';
import 'package:hmg_patient_app_new/features/blood_donation/models/blood_group_hospitals_model.dart'; import 'package:hmg_patient_app_new/features/blood_donation/models/blood_group_hospitals_model.dart';
@ -20,6 +23,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
class BloodDonationViewModel extends ChangeNotifier { class BloodDonationViewModel extends ChangeNotifier {
@ -263,7 +267,13 @@ class BloodDonationViewModel extends ChangeNotifier {
await bloodDonationRepo.updateBloodGroup(request: payload); await bloodDonationRepo.updateBloodGroup(request: payload);
await addUserAgreementForBloodDonation(); await addUserAgreementForBloodDonation();
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
dialogService.showSuccessBottomSheetWithoutH(message: "Blood Group Updated Successfully", onOkPressed: () {}); showCommonBottomSheetWithoutHeight(GetIt.instance<NavigationService>().navigatorKey.currentContext!,
child: Utils.getSuccessWidget(loadingText: "Blood Group Updated Successfully").paddingSymmetrical(0.h, 24.h),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: false,
isAutoDismiss: true);
// dialogService.showSuccessBottomSheetWithoutH(message: "Blood Group Updated Successfully", onOkPressed: () {});
} }
Future<void> addUserAgreementForBloodDonation() async { Future<void> addUserAgreementForBloodDonation() async {

@ -676,9 +676,9 @@ class MyAppointmentsViewModel extends ChangeNotifier {
Future<void> getPatientFavouriteDoctors({bool forceRefresh = false, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientFavouriteDoctors({bool forceRefresh = false, Function(dynamic)? onSuccess, Function(String)? onError}) async {
// If data is already fetched and not forcing refresh, skip API call // If data is already fetched and not forcing refresh, skip API call
if (isFavouriteDoctorsDataFetched && !forceRefresh) { // if (isFavouriteDoctorsDataFetched && !forceRefresh) {
return; // return;
} // }
isPatientFavouriteDoctorsLoading = true; isPatientFavouriteDoctorsLoading = true;
patientFavouriteDoctorsList.clear(); patientFavouriteDoctorsList.clear();

@ -33,6 +33,7 @@ class PrescriptionDetailResponseModel {
num? scaleOffset; num? scaleOffset;
String? startDate; String? startDate;
bool? hasReminder; bool? hasReminder;
bool? isHomeMedicineDeliverySupported;
PrescriptionDetailResponseModel( PrescriptionDetailResponseModel(
{this.address, {this.address,
@ -68,7 +69,7 @@ class PrescriptionDetailResponseModel {
this.sKU, this.sKU,
this.scaleOffset, this.scaleOffset,
this.startDate, this.startDate,
this.hasReminder = false}); this.hasReminder = false, this.isHomeMedicineDeliverySupported});
PrescriptionDetailResponseModel.fromJson(Map<String, dynamic> json) { PrescriptionDetailResponseModel.fromJson(Map<String, dynamic> json) {
address = json['Address']; address = json['Address'];

@ -99,7 +99,11 @@ class PrescriptionsRepoImp implements PrescriptionsRepo {
// throw Exception("prescription list is empty"); // throw Exception("prescription list is empty");
} }
final prescriptionOrders = list.map((item) => PrescriptionDetailResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PrescriptionDetailResponseModel>(); final List<PrescriptionDetailResponseModel> prescriptionOrders =
list.map((item) => PrescriptionDetailResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PrescriptionDetailResponseModel>();
if (prescriptionOrders.isNotEmpty) {
prescriptionOrders.first.isHomeMedicineDeliverySupported = response['IsHomeMedicineDeliverySupported'] ?? false;
}
apiResponse = GenericApiModel<List<PrescriptionDetailResponseModel>>( apiResponse = GenericApiModel<List<PrescriptionDetailResponseModel>>(
messageStatus: messageStatus, messageStatus: messageStatus,

@ -554,7 +554,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
clinicDescription: widget.patientAppointmentHistoryResponseModel.clinicName, clinicDescription: widget.patientAppointmentHistoryResponseModel.clinicName,
decimalDoctorRate: widget.patientAppointmentHistoryResponseModel.decimalDoctorRate, decimalDoctorRate: widget.patientAppointmentHistoryResponseModel.decimalDoctorRate,
name: widget.patientAppointmentHistoryResponseModel.projectName, name: widget.patientAppointmentHistoryResponseModel.projectName,
isHomeMedicineDeliverySupported: false, isHomeMedicineDeliverySupported: val.data.first.isHomeMedicineDeliverySupported ?? false,
projectID: widget.patientAppointmentHistoryResponseModel.projectID, projectID: widget.patientAppointmentHistoryResponseModel.projectID,
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID, clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
doctorID: widget.patientAppointmentHistoryResponseModel.doctorID, doctorID: widget.patientAppointmentHistoryResponseModel.doctorID,
@ -642,6 +642,13 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
); );
}, },
), ),
callBackFunc: () {
myAppointmentsViewModel.getDoctorsRatingCheck(
doctorID: widget.patientAppointmentHistoryResponseModel.doctorID,
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo);
},
isFullScreen: false, isFullScreen: false,
); );
} }

@ -165,7 +165,6 @@ class _AppointmentRatingWidgetState extends State<AppointmentRatingWidget> {
// await appointmentRatingViewModel!.submitClinicRating(clinicRate: rating, clinicNote: note); // await appointmentRatingViewModel!.submitClinicRating(clinicRate: rating, clinicNote: note);
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
Navigator.pop(context); Navigator.pop(context);
setState(() {}); setState(() {});
}, },
), ),

@ -159,14 +159,12 @@ class _AddHealthTrackerEntryPageState extends State<AddHealthTrackerEntryPage> {
context, context,
child: Utils.getSuccessWidget( child: Utils.getSuccessWidget(
loadingText: _getSuccessMessage(), loadingText: _getSuccessMessage(),
), ).paddingSymmetrical(0.h, 24.h), callBackFunc: () {
callBackFunc: () { // Navigator.pop(context);
Navigator.pop(context);
}, },
isCloseButtonVisible: false, isCloseButtonVisible: false,
isDismissible: true, isDismissible: true,
isFullScreen: false, isFullScreen: false, isAutoDismiss: true);
);
} }
// Reusable method to build selection row widget // Reusable method to build selection row widget

@ -430,6 +430,7 @@ class ServicesPage extends StatelessWidget {
title: LandingPageData.getServiceCardsList[index].title, title: LandingPageData.getServiceCardsList[index].title,
subtitle: LandingPageData.getServiceCardsList[index].subtitle, subtitle: LandingPageData.getServiceCardsList[index].subtitle,
icon: LandingPageData.getServiceCardsList[index].largeCardIcon, icon: LandingPageData.getServiceCardsList[index].largeCardIcon,
isPNG: LandingPageData.getServiceCardsList[index].isPNG,
), ),
), ),
), ),
@ -471,7 +472,7 @@ class ServicesPage extends StatelessWidget {
Spacer(), Spacer(),
getIt.get<AppState>().isAuthenticated getIt.get<AppState>().isAuthenticated
? Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) { ? Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
return Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletAmount)), isExpanded: false) return Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletAmount)), isExpanded: false, letterSpacing: -1)
.toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.r, width: 80.w, height: 24.h); .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.r, width: 80.w, height: 24.h);
}) })
: LocaleKeys.loginToViewWalletBalance.tr().toText12(isBold: true, maxLine: 2), : LocaleKeys.loginToViewWalletBalance.tr().toText12(isBold: true, maxLine: 2),

@ -164,6 +164,7 @@ class LandingPageData {
backgroundColor: AppColors.successColor, backgroundColor: AppColors.successColor,
iconColor: AppColors.whiteColor, iconColor: AppColors.whiteColor,
isBold: false, isBold: false,
isPNG: false
), ),
// ServiceCardData( // ServiceCardData(
// icon: AppAssets.homeBottom, // icon: AppAssets.homeBottom,
@ -182,16 +183,18 @@ class LandingPageData {
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,
iconColor: AppColors.whiteColor, iconColor: AppColors.whiteColor,
isBold: false, isBold: false,
isPNG: false
), ),
ServiceCardData( ServiceCardData(
serviceName: "pharmacy", serviceName: "pharmacy",
icon: AppAssets.pharmacy_icon, //359846 icon: AppAssets.defaultMEP, //359846
title: LocaleKeys.hmgPharmacy, title: LocaleKeys.hmgPharmacy,
subtitle: LocaleKeys.hmgPharmacyText, subtitle: LocaleKeys.hmgPharmacyText,
largeCardIcon: AppAssets.pharmacyService, largeCardIcon: AppAssets.pharmacyService,
backgroundColor: AppColors.pharmacyBGColor, backgroundColor: AppColors.pharmacyBGColor,
iconColor: null, iconColor: null,
isBold: true, isBold: true,
isPNG: true
), ),
]; ];
} }

@ -12,6 +12,7 @@ class ServiceCardData {
final Color? backgroundColor; final Color? backgroundColor;
final bool isBold; final bool isBold;
final String largeCardIcon; final String largeCardIcon;
final bool isPNG;
ServiceCardData({ ServiceCardData({
this.serviceName = "", this.serviceName = "",
@ -22,6 +23,7 @@ class ServiceCardData {
this.backgroundColor, this.backgroundColor,
this.iconColor, this.iconColor,
this.textColor, this.textColor,
this.isBold = false this.isBold = false,
this.isPNG = false,
}); });
} }

@ -204,7 +204,7 @@ class _LandingPageState extends State<LandingPage> {
// Refresh Appointments Data // Refresh Appointments Data
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.initAppointmentsViewModel(); myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, true); myAppointmentsViewModel.getPatientAppointments(true, false);
// Refresh Appointments Data // Refresh Appointments Data
habibWalletVM.initHabibWalletProvider(); habibWalletVM.initHabibWalletProvider();
@ -822,6 +822,7 @@ class _LandingPageState extends State<LandingPage> {
title: LandingPageData.getServiceCardsList[index].title, title: LandingPageData.getServiceCardsList[index].title,
subtitle: LandingPageData.getServiceCardsList[index].subtitle, subtitle: LandingPageData.getServiceCardsList[index].subtitle,
icon: LandingPageData.getServiceCardsList[index].largeCardIcon, icon: LandingPageData.getServiceCardsList[index].largeCardIcon,
isPNG: LandingPageData.getServiceCardsList[index].isPNG,
), ),
), ),
), ),

@ -28,6 +28,7 @@ class LargeServiceCard extends StatelessWidget {
final String icon; final String icon;
final String title; final String title;
final String subtitle; final String subtitle;
final bool isPNG;
const LargeServiceCard({ const LargeServiceCard({
super.key, super.key,
@ -36,6 +37,7 @@ class LargeServiceCard extends StatelessWidget {
this.icon = "", this.icon = "",
this.title = "", this.title = "",
this.subtitle = "", this.subtitle = "",
this.isPNG = false,
}); });
@override @override
@ -72,7 +74,7 @@ class LargeServiceCard extends StatelessWidget {
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( isPNG ? Image.asset(serviceCardData.icon, width: 35.h, height: 35.h) : Container(
height: 48.h, height: 48.h,
width: 48.h, width: 48.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
@ -172,6 +174,7 @@ class FadedLargeServiceCard extends StatelessWidget {
final String icon; final String icon;
final String title; final String title;
final String subtitle; final String subtitle;
final bool isPNG;
const FadedLargeServiceCard({ const FadedLargeServiceCard({
super.key, super.key,
@ -180,6 +183,7 @@ class FadedLargeServiceCard extends StatelessWidget {
this.icon = "", this.icon = "",
this.title = "", this.title = "",
this.subtitle = "", this.subtitle = "",
this.isPNG = false,
}); });
@override @override
@ -225,7 +229,7 @@ class FadedLargeServiceCard extends StatelessWidget {
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( isPNG ? Image.asset(serviceCardData.icon, width: 35.h, height: 35.h) : Container(
height: 32.h, height: 32.h,
width: 32.h, width: 32.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(

@ -979,7 +979,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
), ),
).paddingSymmetrical(0.w, 0.h) ).paddingSymmetrical(0.w, 0.h)
: SizedBox( : SizedBox(
height: 100.h, height: 110.h,
child: ListView.separated( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: myAppointmentsVM.patientMyDoctorsList.length, itemCount: myAppointmentsVM.patientMyDoctorsList.length,
@ -1003,7 +1003,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
fit: BoxFit.cover, fit: BoxFit.cover,
).circle(100).toShimmer2(isShow: false, radius: 50.r), ).circle(100).toShimmer2(isShow: false, radius: 50.r),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Expanded( SizedBox(
width: 80.w,
child: (myAppointmentsVM.patientMyDoctorsList[index].doctorName) child: (myAppointmentsVM.patientMyDoctorsList[index].doctorName)
.toString().toText12(isBold: true, isCenter: true, maxLine: 2).toShimmer2(isShow: false), .toString().toText12(isBold: true, isCenter: true, maxLine: 2).toShimmer2(isShow: false),
), ),

@ -163,25 +163,27 @@ class MedicalFileAppointmentCard extends StatelessWidget {
} }
Widget getArrivedAppointmentButton(BuildContext context) { Widget getArrivedAppointmentButton(BuildContext context) {
return DateTime.now().difference(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate)).inDays <= 15 return
? CustomButton( // DateTime.now().difference(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate)).inDays <= 15
text: LocaleKeys.askDoctor.tr(context: context), // ? CustomButton(
onPressed: () { // text: LocaleKeys.askDoctor.tr(context: context),
onAskDoctorTap(); // onPressed: () {
}, // onAskDoctorTap();
backgroundColor: AppColors.secondaryLightRedColor, // },
borderColor: AppColors.secondaryLightRedColor, // backgroundColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor, // borderColor: AppColors.secondaryLightRedColor,
fontSize: 14.f, // textColor: AppColors.primaryRedColor,
fontWeight: FontWeight.w600, // fontSize: 14.f,
borderRadius: 12.r, // fontWeight: FontWeight.w600,
padding: EdgeInsets.symmetric(horizontal: 10.w), // borderRadius: 12.r,
height: 40.h, // padding: EdgeInsets.symmetric(horizontal: 10.w),
icon: AppAssets.ask_doctor_icon, // height: 40.h,
iconColor: AppColors.primaryRedColor, // icon: AppAssets.ask_doctor_icon,
iconSize: 16.h, // iconColor: AppColors.primaryRedColor,
) // iconSize: 16.h,
: CustomButton( // )
// :
CustomButton(
text: LocaleKeys.rebook.tr(context: context), text: LocaleKeys.rebook.tr(context: context),
onPressed: () { onPressed: () {
onRescheduleTap(); onRescheduleTap();

Loading…
Cancel
Save