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 1 day 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 fullBodyBackFemale = '$pngBasePath/full_body_back_female.png';
static const String bmiFullBody = '$pngBasePath/bmi_image_1.png';
static const String defaultMEP = '$pngBasePath/default_MEP.png';
}
class AppAnimations {

@ -923,7 +923,8 @@ class Utils {
),
TextSpan(
// 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(
color: resolvedTextColor,
fontSize: fontSize ?? 32.f,

@ -1,11 +1,14 @@
import 'package:easy_localization/easy_localization.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/dependencies.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/size_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/widget_extensions.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/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/error_handler_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';
class BloodDonationViewModel extends ChangeNotifier {
@ -263,7 +267,13 @@ class BloodDonationViewModel extends ChangeNotifier {
await bloodDonationRepo.updateBloodGroup(request: payload);
await addUserAgreementForBloodDonation();
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 {

@ -676,9 +676,9 @@ class MyAppointmentsViewModel extends ChangeNotifier {
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 (isFavouriteDoctorsDataFetched && !forceRefresh) {
return;
}
// if (isFavouriteDoctorsDataFetched && !forceRefresh) {
// return;
// }
isPatientFavouriteDoctorsLoading = true;
patientFavouriteDoctorsList.clear();

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

@ -99,7 +99,11 @@ class PrescriptionsRepoImp implements PrescriptionsRepo {
// 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>>(
messageStatus: messageStatus,

@ -554,7 +554,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
clinicDescription: widget.patientAppointmentHistoryResponseModel.clinicName,
decimalDoctorRate: widget.patientAppointmentHistoryResponseModel.decimalDoctorRate,
name: widget.patientAppointmentHistoryResponseModel.projectName,
isHomeMedicineDeliverySupported: false,
isHomeMedicineDeliverySupported: val.data.first.isHomeMedicineDeliverySupported ?? false,
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
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,
);
}

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

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

@ -430,6 +430,7 @@ class ServicesPage extends StatelessWidget {
title: LandingPageData.getServiceCardsList[index].title,
subtitle: LandingPageData.getServiceCardsList[index].subtitle,
icon: LandingPageData.getServiceCardsList[index].largeCardIcon,
isPNG: LandingPageData.getServiceCardsList[index].isPNG,
),
),
),
@ -471,7 +472,7 @@ class ServicesPage extends StatelessWidget {
Spacer(),
getIt.get<AppState>().isAuthenticated
? 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);
})
: LocaleKeys.loginToViewWalletBalance.tr().toText12(isBold: true, maxLine: 2),

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

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

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

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

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

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

Loading…
Cancel
Save