pull/199/head
haroon amjad 21 hours ago
parent 1709b80e84
commit d4ed2b47bc

@ -144,18 +144,7 @@ class ContactUsViewModel extends ChangeNotifier {
} }
} }
if (hmgHospitalsLocationsList.first.distanceInKilometers != 0) { sortHMGLocations(hasLocationEnabled);
hmgHospitalsLocationsList.sort((a, b) => a.distanceInKilometers.compareTo(b.distanceInKilometers));
} else {
hmgHospitalsLocationsList.sort((a, b) => a.locationName!.compareTo(b.locationName!));
}
if (hmgPharmacyLocationsList.first.distanceInKilometers != 0) {
hmgPharmacyLocationsList.sort((a, b) => a.distanceInKilometers.compareTo(b.distanceInKilometers));
} else {
hmgPharmacyLocationsList.sort((a, b) => a.locationName!.compareTo(b.locationName!));
}
isHMGLocationsListLoading = false; isHMGLocationsListLoading = false;
notifyListeners(); notifyListeners();
if (onSuccess != null) { if (onSuccess != null) {
@ -166,6 +155,17 @@ class ContactUsViewModel extends ChangeNotifier {
); );
} }
sortHMGLocations(bool isByLocation) {
if (isByLocation) {
hmgHospitalsLocationsList.sort((a, b) => a.distanceInKilometers.compareTo(b.distanceInKilometers));
hmgPharmacyLocationsList.sort((a, b) => a.distanceInKilometers.compareTo(b.distanceInKilometers));
} else {
hmgHospitalsLocationsList.sort((a, b) => a.locationName!.compareTo(b.locationName!));
hmgPharmacyLocationsList.sort((a, b) => a.locationName!.compareTo(b.locationName!));
}
notifyListeners();
}
Future<void> getLiveChatProjectsList({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getLiveChatProjectsList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
isLiveChatProjectsListLoading = true; isLiveChatProjectsListLoading = true;
liveChatProjectsList.clear(); liveChatProjectsList.clear();

@ -60,6 +60,9 @@ class MyInvoicesViewModel extends ChangeNotifier {
(failure) async { (failure) async {
isInvoiceDetailsLoading = false; isInvoiceDetailsLoading = false;
notifyListeners(); notifyListeners();
if (onError != null) {
onError(failure.message);
}
}, },
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {

@ -19,6 +19,7 @@ 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/map/map_utility_screen.dart'; import 'package:hmg_patient_app_new/widgets/map/map_utility_screen.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:permission_handler/permission_handler.dart';
class PrescriptionsViewModel extends ChangeNotifier { class PrescriptionsViewModel extends ChangeNotifier {
bool isPrescriptionsOrdersLoading = false; bool isPrescriptionsOrdersLoading = false;
@ -68,9 +69,9 @@ class PrescriptionsViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
Future<bool> checkIfReminderExistForPrescription(int index) async {
checkIfReminderExistForPrescription(int index) async {
prescriptionDetailsList[index].hasReminder = await CalenderUtilsNew.instance.checkIfEventExist(prescriptionDetailsList[index].itemID?.toString() ?? ""); prescriptionDetailsList[index].hasReminder = await CalenderUtilsNew.instance.checkIfEventExist(prescriptionDetailsList[index].itemID?.toString() ?? "");
return prescriptionDetailsList[index].hasReminder ?? false;
} }
setPrescriptionsDetailsLoading() { setPrescriptionsDetailsLoading() {
@ -157,14 +158,16 @@ class PrescriptionsViewModel extends ChangeNotifier {
(failure) async { (failure) async {
onError!(failure.message); onError!(failure.message);
}, },
(apiResponse) { (apiResponse) async {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) { } else if (apiResponse.messageStatus == 1) {
prescriptionDetailsList = apiResponse.data!; prescriptionDetailsList = apiResponse.data!;
prescriptionDetailsList.forEach((element) async { if (await Permission.calendarFullAccess.isGranted && await Permission.calendarWriteOnly.isGranted) {
// await checkIfReminderExistForPrescription(prescriptionDetailsList.indexOf(element)); prescriptionDetailsList.forEach((element) async {
}); await checkIfReminderExistForPrescription(prescriptionDetailsList.indexOf(element));
});
}
isPrescriptionsDetailsLoading = false; isPrescriptionsDetailsLoading = false;
notifyListeners(); notifyListeners();
if (onSuccess != null) { if (onSuccess != null) {

@ -104,8 +104,8 @@ class AppointmentCard extends StatelessWidget {
AppCustomChipWidget( AppCustomChipWidget(
labelText: labelText:
isLoading ? 'OutPatient' : (appState.isArabic() ? patientAppointmentHistoryResponseModel.isInOutPatientDescriptionN! : patientAppointmentHistoryResponseModel.isInOutPatientDescription!), isLoading ? 'OutPatient' : (appState.isArabic() ? patientAppointmentHistoryResponseModel.isInOutPatientDescriptionN! : patientAppointmentHistoryResponseModel.isInOutPatientDescription!),
backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.1), backgroundColor: AppColors.warningColorYellow.withValues(alpha: 0.1),
textColor: AppColors.primaryRedColor, textColor: AppColors.warningColorYellow,
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
AppCustomChipWidget( AppCustomChipWidget(
labelText: isLoading ? 'Booked' : AppointmentType.getAppointmentStatusType(patientAppointmentHistoryResponseModel.patientStatusType!), labelText: isLoading ? 'Booked' : AppointmentType.getAppointmentStatusType(patientAppointmentHistoryResponseModel.patientStatusType!),

@ -59,10 +59,14 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
bookAppointmentsViewModel.initBookAppointmentViewModel(); bookAppointmentsViewModel.initBookAppointmentViewModel();
bookAppointmentsViewModel.getLocation(); bookAppointmentsViewModel.getLocation();
immediateLiveCareViewModel.initImmediateLiveCare(); immediateLiveCareViewModel.initImmediateLiveCare();
if (appState.isAuthenticated) {
getIt.get<MyAppointmentsViewModel>().getPatientMyDoctors();
}
}); });
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (bookAppointmentsViewModel.selectedTabIndex == 1) { if (bookAppointmentsViewModel.selectedTabIndex == 1) {
if (appState.isAuthenticated) { if (appState.isAuthenticated) {
getIt.get<MyAppointmentsViewModel>().getPatientMyDoctors();
showUnKnownClinicBottomSheet(); showUnKnownClinicBottomSheet();
} }
} else { } else {

@ -33,15 +33,6 @@ class FindUsPage extends StatelessWidget {
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
body: CollapsingListView( body: CollapsingListView(
title: LocaleKeys.location.tr(), title: LocaleKeys.location.tr(),
location: contactUsViewModel.hasLocationEnabled
? null
: () {
locationUtils.getCurrentLocation(
onSuccess: (value) {
contactUsViewModel.initContactUsViewModel();
},
onFailure: () {},);
},
child: Consumer<ContactUsViewModel>(builder: (context, contactUsVM, child) { child: Consumer<ContactUsViewModel>(builder: (context, contactUsVM, child) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -60,8 +51,48 @@ class FindUsPage extends StatelessWidget {
contactUsVM.setHMGHospitalsListSelected(index == 0); contactUsVM.setHMGHospitalsListSelected(index == 0);
}, },
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.sortByLocation.tr(context: context).toText14(isBold: true),
SizedBox(height: 4.h),
"Sort the locations by nearest to your location".toText11(color: AppColors.textColorLight, weight: FontWeight.w500),
],
),
const Spacer(),
Switch(
activeThumbColor: AppColors.successColor,
activeTrackColor: AppColors.successColor.withValues(alpha: .15),
value: contactUsVM.hasLocationEnabled,
onChanged: (newValue) async {
if (newValue) {
locationUtils.getCurrentLocation(
onSuccess: (value) {
// if (contactUsVM.hmgHospitalsLocationsList.isNotEmpty) {
// contactUsVM.sortHMGLocations(true);
// contactUsVM.setHasLocationEnabled(newValue);
// } else {
contactUsVM.initContactUsViewModel();
contactUsVM.setHasLocationEnabled(newValue);
contactUsVM.sortHMGLocations(true);
// }
},
onFailure: () {},
);
} else {
contactUsVM.sortHMGLocations(false);
contactUsVM.setHasLocationEnabled(newValue);
}
// bookAppointmentsVM.setIsNearestAppointmentSelected(newValue);
},
),
],
).paddingSymmetrical(24.h, 12.h),
ListView.separated( ListView.separated(
padding: EdgeInsets.only(top: 16.h), padding: EdgeInsets.only(top: 4.h),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: contactUsVM.isHMGLocationsListLoading itemCount: contactUsVM.isHMGLocationsListLoading

@ -6,24 +6,30 @@ 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/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/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/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/contact_us/contact_us_view_model.dart';
import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_hmg_locations.dart'; import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_hmg_locations.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/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/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:map_launcher/map_launcher.dart'; import 'package:map_launcher/map_launcher.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class FindUsItemCard extends StatelessWidget { class FindUsItemCard extends StatelessWidget {
FindUsItemCard({super.key, required this.getHMGLocationsModel}); FindUsItemCard({super.key, required this.getHMGLocationsModel});
late AppState appState; late AppState appState;
late ContactUsViewModel contactUsViewModel;
GetHMGLocationsModel getHMGLocationsModel; GetHMGLocationsModel getHMGLocationsModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
appState = getIt.get<AppState>(); appState = getIt.get<AppState>();
contactUsViewModel = getIt.get<ContactUsViewModel>();
return DecoratedBox( return DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
@ -45,73 +51,108 @@ class FindUsItemCard extends StatelessWidget {
); );
} }
Widget get hospitalName => Row( Widget get hospitalName => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.network( (getHMGLocationsModel.distanceInKilometers != 0 && contactUsViewModel.hasLocationEnabled)
getHMGLocationsModel.projectImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", ? Column(
width: 40.h, children: [
height: 40.h, AppCustomChipWidget(
fit: BoxFit.cover, labelText: "${getHMGLocationsModel.distanceInKilometers ?? ""} km",
).circle(100).toShimmer2(isShow: false).paddingOnly(right: 10), labelPadding: EdgeInsetsDirectional.only(start: -4.h, end: 8.w),
Expanded( icon: AppAssets.location_red,
child: Text( // iconColor: AppColors.primaryRedColor,
getHMGLocationsModel.locationName!, // backgroundColor: AppColors.secondaryLightRedColor,
style: TextStyle( // textColor: AppColors.errorColor,
fontWeight: FontWeight.w600, ),
fontSize: 16, SizedBox(
color: AppColors.blackColor, height: 16.h,
), ),
), ],
) )
: SizedBox.shrink(),
Row(
children: [
Image.network(
getHMGLocationsModel.projectImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
width: 40.h,
height: 40.h,
fit: BoxFit.cover,
).circle(100).toShimmer2(isShow: false).paddingOnly(right: 10),
Expanded(
child: Text(
getHMGLocationsModel.locationName!,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16,
color: AppColors.blackColor,
),
),
)
],
),
], ],
); );
Widget get distanceInfo => Row( Widget get distanceInfo => Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
getHMGLocationsModel.distanceInKilometers != 0 Expanded(
? AppCustomChipWidget( flex: 7,
labelText: "${getHMGLocationsModel.distanceInKilometers ?? ""} km", child: CustomButton(
icon: AppAssets.location_red, text: LocaleKeys.getDirections.tr(),
iconColor: AppColors.primaryRedColor, onPressed: () async {
backgroundColor: AppColors.secondaryLightRedColor, await MapLauncher.showMarker(
textColor: AppColors.errorColor, mapType: MapType.google,
) coords: Coords(double.parse(getHMGLocationsModel.latitude ?? "0.0"), double.parse(getHMGLocationsModel.longitude ?? "0.0")),
: SizedBox.shrink(), title: getHMGLocationsModel.locationName ?? "Hospital",
Row( ).catchError((err) {
children: [ MapLauncher.showMarker(
AppCustomChipWidget( mapType: Platform.isIOS ? MapType.apple : MapType.google,
labelText: LocaleKeys.getDirections.tr(),
icon: AppAssets.directions_icon,
iconColor: AppColors.whiteColor,
backgroundColor: AppColors.textColor.withValues(alpha: 0.8),
textColor: AppColors.whiteColor,
onChipTap: () async {
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(getHMGLocationsModel.latitude ?? "0.0"), double.parse(getHMGLocationsModel.longitude ?? "0.0")), coords: Coords(double.parse(getHMGLocationsModel.latitude ?? "0.0"), double.parse(getHMGLocationsModel.longitude ?? "0.0")),
title: getHMGLocationsModel.locationName ?? "Hospital", title: getHMGLocationsModel.locationName ?? "Hospital",
).catchError((err) { );
MapLauncher.showMarker( });
mapType: Platform.isIOS ? MapType.apple : MapType.google, },
coords: Coords(double.parse(getHMGLocationsModel.latitude ?? "0.0"), double.parse(getHMGLocationsModel.longitude ?? "0.0")), backgroundColor: AppColors.transparent,
title: getHMGLocationsModel.locationName ?? "Hospital", borderColor: AppColors.textColor,
); textColor: AppColors.blackColor,
}); borderWidth: 1.h,
}, fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
fontWeight: FontWeight.w500,
borderRadius: 12.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
height: 40.h,
icon: AppAssets.directions_icon,
iconColor: AppColors.blackColor,
iconSize: 16.h,
),
),
SizedBox(width: 8.w),
Expanded(
flex: 1,
child: Container(
height: (isFoldable || isTablet) ? 50.h : 40.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.transparent,
borderRadius: 10.h,
side: BorderSide(
color: AppColors.textColor,
width: 1.2,
),
), ),
SizedBox(width: 4.w), child: Transform.flip(
AppCustomChipWidget( flipX: appState.isArabic(),
labelText: LocaleKeys.callNow.tr(), child: Utils.buildSvgWithAssets(
icon: AppAssets.call_fill, icon: AppAssets.call_fill,
iconColor: Colors.white, iconColor: AppColors.textColor,
backgroundColor: AppColors.primaryRedColor.withValues(alpha: 1.0), width: 5.w,
textColor: Colors.white, height: 5.h,
onChipTap: () { fit: BoxFit.scaleDown,
launchUrl(Uri.parse("tel://" + "${getHMGLocationsModel.phoneNumber}")); ),
},
), ),
], ).onPress(() {
launchUrl(Uri.parse("tel://" + "${getHMGLocationsModel.phoneNumber}"));
}),
), ),
], ],
); );

@ -63,8 +63,8 @@ class InsuranceApprovalDetailsPage extends StatelessWidget {
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: appState.isArabic() ? insuranceApprovalResponseModel.isInOutPatientDescriptionN! : insuranceApprovalResponseModel.isInOutPatientDescription!, labelText: appState.isArabic() ? insuranceApprovalResponseModel.isInOutPatientDescriptionN! : insuranceApprovalResponseModel.isInOutPatientDescription!,
backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), backgroundColor: AppColors.warningColorYellow.withOpacity(0.1),
textColor: AppColors.primaryRedColor, textColor: AppColors.warningColorYellow,
), ),
], ],
), ),

@ -51,7 +51,7 @@ class _InsuranceApprovalsPageState extends State<InsuranceApprovalsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
ListView.separated( ListView.separated(
padding: EdgeInsets.only(top: 24.h), padding: EdgeInsets.only(top: 12.h),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: insuranceVM.isInsuranceApprovalsLoading itemCount: insuranceVM.isInsuranceApprovalsLoading

@ -9,8 +9,11 @@ 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/insurance/models/resp_models/patient_insurance_approval_response_model.dart'; import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_approval_response_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/insurance/insurance_approval_details_page.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/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
class InsuranceApprovalCard extends StatelessWidget { class InsuranceApprovalCard extends StatelessWidget {
InsuranceApprovalCard({super.key, required this.insuranceApprovalResponseModel, required this.isLoading, required this.appState}); InsuranceApprovalCard({super.key, required this.insuranceApprovalResponseModel, required this.isLoading, required this.appState});
@ -64,8 +67,8 @@ class InsuranceApprovalCard extends StatelessWidget {
: appState.isArabic() : appState.isArabic()
? insuranceApprovalResponseModel.isInOutPatientDescriptionN! ? insuranceApprovalResponseModel.isInOutPatientDescriptionN!
: insuranceApprovalResponseModel.isInOutPatientDescription!, : insuranceApprovalResponseModel.isInOutPatientDescription!,
backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), backgroundColor: AppColors.warningColorYellow.withOpacity(0.1),
textColor: AppColors.primaryRedColor, textColor: AppColors.warningColorYellow,
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
], ],
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
@ -111,12 +114,30 @@ class InsuranceApprovalCard extends StatelessWidget {
), ),
], ],
), ),
Row( SizedBox(
mainAxisAlignment: MainAxisAlignment.end, height: 12.h,
children: [ ),
Transform.flip( CustomButton(
flipX: appState.isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon_small, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor)), text: LocaleKeys.viewDetails.tr(context: context),
], onPressed: () async {
Navigator.of(context).push(
CustomPageRoute(
page: InsuranceApprovalDetailsPage(insuranceApprovalResponseModel: insuranceApprovalResponseModel),
),
);
},
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
fontWeight: FontWeight.w500,
borderRadius: 12.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
height: isTablet || isFoldable ? 46.h : 40.h,
// height: 40.h,
// icon: AppAssets.insurance,
// iconColor: AppColors.primaryRedColor,
iconSize: 16.h,
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
], ],
), ),

File diff suppressed because one or more lines are too long

@ -57,48 +57,48 @@ class _PatientSickleavesListPageState extends State<PatientSickleavesListPage> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 16.h), // SizedBox(height: 16.h),
// Clinic & Hospital Sort // Clinic & Hospital Sort
Row( // Row(
children: [ // children: [
CustomButton( // CustomButton(
text: LocaleKeys.byClinic.tr(context: context), // text: LocaleKeys.byClinic.tr(context: context),
onPressed: () { // onPressed: () {
model.setIsSickLeavesSortByClinic(true); // model.setIsSickLeavesSortByClinic(true);
}, // },
backgroundColor: model.isSickLeavesSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor, // backgroundColor: model.isSickLeavesSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor,
borderColor: model.isSickLeavesSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withValues(alpha: 0.2), // borderColor: model.isSickLeavesSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withValues(alpha: 0.2),
textColor: model.isSickLeavesSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor, // textColor: model.isSickLeavesSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor,
fontSize: 12, // fontSize: 12,
fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
borderRadius: 10, // borderRadius: 10,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h, // height: 40.h,
), // ),
SizedBox(width: 8.h), // SizedBox(width: 8.h),
CustomButton( // CustomButton(
text: LocaleKeys.byHospital.tr(context: context), // text: LocaleKeys.byHospital.tr(context: context),
onPressed: () { // onPressed: () {
model.setIsSickLeavesSortByClinic(false); // model.setIsSickLeavesSortByClinic(false);
}, // },
backgroundColor: model.isSickLeavesSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor, // backgroundColor: model.isSickLeavesSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor,
borderColor: model.isSickLeavesSortByClinic ? AppColors.textColor.withValues(alpha: 0.2) : AppColors.primaryRedColor, // borderColor: model.isSickLeavesSortByClinic ? AppColors.textColor.withValues(alpha: 0.2) : AppColors.primaryRedColor,
textColor: model.isSickLeavesSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor, // textColor: model.isSickLeavesSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor,
fontSize: 12, // fontSize: 12,
fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
borderRadius: 10, // borderRadius: 10,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h, // height: 40.h,
), // ),
], // ],
).paddingSymmetrical(24.h, 0.h), // ).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 20.h), // SizedBox(height: 20.h),
// Expandable list // Expandable list
ListView.builder( ListView.builder(
itemCount: model.isPatientSickLeaveListLoading itemCount: model.isPatientSickLeaveListLoading
? 4 ? 4
: model.patientSickLeaveList.isNotEmpty : model.patientSickLeaveList.isNotEmpty
? model.patientSickLeavesViewList.length ? model.patientSickLeaveList.length
: 1, : 1,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
@ -122,155 +122,322 @@ class _PatientSickleavesListPageState extends State<PatientSickleavesListPage> {
curve: Curves.easeInOut, curve: Curves.easeInOut,
margin: EdgeInsets.symmetric(vertical: 8.h), margin: EdgeInsets.symmetric(vertical: 8.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true),
child: InkWell( child: Container(
onTap: () { padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 16.h),
setState(() { child: Column(
expandedIndex = isExpanded ? null : index; crossAxisAlignment: CrossAxisAlignment.start,
}); children: [
}, AppCustomChipWidget(
child: Column( labelText:
crossAxisAlignment: CrossAxisAlignment.start, "${getIt.get<AppState>().isArabic() ? model.patientSickLeaveList[index].isInOutPatientDescriptionN : model.patientSickLeaveList[index].isInOutPatientDescription}",
children: [ backgroundColor: AppColors.warningColorYellow.withOpacity(0.1),
Padding( textColor: AppColors.warningColorYellow,
padding: EdgeInsets.all(16.h), ),
child: Column( SizedBox(height: 16.h),
crossAxisAlignment: CrossAxisAlignment.start, Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.network(
model.patientSickLeaveList[index].doctorImageURL!,
width: 24.h,
height: 24.h,
fit: BoxFit.fill,
).circle(100),
SizedBox(width: 8.h),
Expanded(child: model.patientSickLeaveList[index].doctorName!.toText14(weight: FontWeight.w500)),
],
),
SizedBox(height: 8.h),
Wrap(
direction: Axis.horizontal,
spacing: 6.h,
runSpacing: 6.h,
children: [ children: [
Row( AppCustomChipWidget(
mainAxisAlignment: MainAxisAlignment.spaceBetween, labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(model.patientSickLeaveList[index].appointmentDate), false),
children: [ ),
CustomButton( AppCustomChipWidget(
text: "${model.patientSickLeavesViewList[index].sickLeavesList!.length} ${LocaleKeys.sickSubtitle.tr(context: context)} Available", labelText: model.isSickLeavesSortByClinic ? model.patientSickLeaveList[index].projectName! : model.patientSickLeaveList[index].clinicName!,
onPressed: () {}, ),
backgroundColor: AppColors.greyColor, AppCustomChipWidget(
borderColor: AppColors.greyColor, labelText: "${model.patientSickLeaveList[index].sickLeaveDays} Days",
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
Icon(isExpanded ? Icons.expand_less : Icons.expand_more),
],
), ),
SizedBox(height: 8.h),
model.patientSickLeavesViewList[index].filterName!.toText16(isBold: true)
], ],
), ),
), SizedBox(height: 12.h),
AnimatedSwitcher( Row(
duration: Duration(milliseconds: 500), children: [
switchInCurve: Curves.easeIn, Expanded(
switchOutCurve: Curves.easeOut, flex: 6,
transitionBuilder: (Widget child, Animation<double> animation) { child: CustomButton(
return FadeTransition( text: LocaleKeys.downloadReport.tr(context: context),
opacity: animation, onPressed: () async {
child: SizeTransition( LoaderBottomSheet.showLoader();
sizeFactor: animation, await medicalFileViewModel.getPatientSickLeavePDF(model.patientSickLeaveList[index], appState.getAuthenticatedUser()!).then((val) async {
axisAlignment: 0.0, LoaderBottomSheet.hideLoader();
child: child, if (medicalFileViewModel.patientSickLeavePDFBase64.isNotEmpty) {
String path = await Utils.createFileFromString(medicalFileViewModel.patientSickLeavePDFBase64, "pdf");
try {
OpenFilex.open(path);
} catch (ex) {
debugPrint("Error opening file: $ex");
}
}
});
},
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h,
icon: AppAssets.download,
iconColor: AppColors.primaryRedColor,
iconSize: 14.h,
),
), ),
); ],
}, ),
child: isExpanded // SizedBox(height: 12.h),
? Container( // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
key: ValueKey<int>(index), // SizedBox(height: 12.h),
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 8.h), ],
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, // Column(
children: [ // crossAxisAlignment: CrossAxisAlignment.start,
...model.patientSickLeavesViewList[index].sickLeavesList!.map((sickLeave) { // children: [
return Column( // ...model.patientSickLeaveList[index].sickLeavesList!.map((sickLeave) {
crossAxisAlignment: CrossAxisAlignment.start, // return Column(
children: [ // crossAxisAlignment: CrossAxisAlignment.start,
Row( // children: [
mainAxisSize: MainAxisSize.min, // Row(
children: [ // mainAxisSize: MainAxisSize.min,
Image.network( // children: [
sickLeave.doctorImageURL!, // Image.network(
width: 24.h, // sickLeave.doctorImageURL!,
height: 24.h, // width: 24.h,
fit: BoxFit.fill, // height: 24.h,
).circle(100), // fit: BoxFit.fill,
SizedBox(width: 8.h), // ).circle(100),
Expanded(child: sickLeave.doctorName!.toText14(weight: FontWeight.w500)), // SizedBox(width: 8.h),
], // Expanded(child: sickLeave.doctorName!.toText14(weight: FontWeight.w500)),
), // ],
SizedBox(height: 8.h), // ),
Wrap( // SizedBox(height: 8.h),
direction: Axis.horizontal, // Wrap(
spacing: 6.h, // direction: Axis.horizontal,
runSpacing: 6.h, // spacing: 6.h,
children: [ // runSpacing: 6.h,
AppCustomChipWidget( // children: [
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(sickLeave.appointmentDate), false), // AppCustomChipWidget(
), // labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(sickLeave.appointmentDate), false),
AppCustomChipWidget( // ),
labelText: model.isSickLeavesSortByClinic ? sickLeave.projectName! : sickLeave.clinicName!, // AppCustomChipWidget(
), // labelText: model.isSickLeavesSortByClinic ? sickLeave.projectName! : sickLeave.clinicName!,
AppCustomChipWidget( // ),
labelText: "${sickLeave.sickLeaveDays} Days", // AppCustomChipWidget(
), // labelText: "${sickLeave.sickLeaveDays} Days",
], // ),
), // ],
SizedBox(height: 12.h), // ),
Row( // SizedBox(height: 12.h),
children: [ // Row(
Expanded( // children: [
flex: 6, // Expanded(
child: CustomButton( // flex: 6,
text: LocaleKeys.downloadReport.tr(context: context), // child: CustomButton(
onPressed: () async { // text: LocaleKeys.downloadReport.tr(context: context),
LoaderBottomSheet.showLoader(); // onPressed: () async {
await medicalFileViewModel.getPatientSickLeavePDF(sickLeave, appState.getAuthenticatedUser()!).then((val) async { // LoaderBottomSheet.showLoader();
LoaderBottomSheet.hideLoader(); // await medicalFileViewModel.getPatientSickLeavePDF(sickLeave, appState.getAuthenticatedUser()!).then((val) async {
if (medicalFileViewModel.patientSickLeavePDFBase64.isNotEmpty) { // LoaderBottomSheet.hideLoader();
String path = await Utils.createFileFromString(medicalFileViewModel.patientSickLeavePDFBase64, "pdf"); // if (medicalFileViewModel.patientSickLeavePDFBase64.isNotEmpty) {
try { // String path = await Utils.createFileFromString(medicalFileViewModel.patientSickLeavePDFBase64, "pdf");
OpenFilex.open(path); // try {
} catch (ex) { // OpenFilex.open(path);
debugPrint("Error opening file: $ex"); // } catch (ex) {
} // debugPrint("Error opening file: $ex");
} // }
}); // }
}, // });
backgroundColor: AppColors.secondaryLightRedColor, // },
borderColor: AppColors.secondaryLightRedColor, // backgroundColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor, // borderColor: AppColors.secondaryLightRedColor,
fontSize: 14, // textColor: AppColors.primaryRedColor,
fontWeight: FontWeight.w500, // fontSize: 14,
borderRadius: 12, // fontWeight: FontWeight.w500,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // borderRadius: 12,
height: 40.h, // padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
icon: AppAssets.download, // height: 40.h,
iconColor: AppColors.primaryRedColor, // icon: AppAssets.download,
iconSize: 14.h, // iconColor: AppColors.primaryRedColor,
), // iconSize: 14.h,
), // ),
], // ),
), // ],
SizedBox(height: 12.h), // ),
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), // SizedBox(height: 12.h),
SizedBox(height: 12.h), // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
], // SizedBox(height: 12.h),
); // ],
}), // );
], // }),
), // ],
) // ),
: SizedBox.shrink(), )
), // InkWell(
], // onTap: () {
// setState(() {
// expandedIndex = isExpanded ? null : index;
// });
// },
// child:
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Padding(
// padding: EdgeInsets.all(16.h),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// CustomButton(
// text: "${model.patientSickLeavesViewList[index].sickLeavesList!.length} ${LocaleKeys.sickSubtitle.tr(context: context)} Available",
// onPressed: () {},
// backgroundColor: AppColors.greyColor,
// borderColor: AppColors.greyColor,
// textColor: AppColors.blackColor,
// fontSize: 10,
// fontWeight: FontWeight.w500,
// borderRadius: 8,
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
// height: 30.h,
// ),
// Icon(isExpanded ? Icons.expand_less : Icons.expand_more),
// ],
// ),
// SizedBox(height: 8.h),
// model.patientSickLeavesViewList[index].filterName!.toText16(isBold: true)
// ],
// ),
// ),
// // AnimatedSwitcher(
// // duration: Duration(milliseconds: 500),
// // switchInCurve: Curves.easeIn,
// // switchOutCurve: Curves.easeOut,
// // transitionBuilder: (Widget child, Animation<double> animation) {
// // return FadeTransition(
// // opacity: animation,
// // child: SizeTransition(
// // sizeFactor: animation,
// // axisAlignment: 0.0,
// // child: child,
// // ),
// // );
// // },
// // child: isExpanded
// // ? Container(
// // key: ValueKey<int>(index),
// // padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 8.h),
// // child: Column(
// // crossAxisAlignment: CrossAxisAlignment.start,
// // children: [
// // ...model.patientSickLeavesViewList[index].sickLeavesList!.map((sickLeave) {
// // return Column(
// // crossAxisAlignment: CrossAxisAlignment.start,
// // children: [
// // Row(
// // mainAxisSize: MainAxisSize.min,
// // children: [
// // Image.network(
// // sickLeave.doctorImageURL!,
// // width: 24.h,
// // height: 24.h,
// // fit: BoxFit.fill,
// // ).circle(100),
// // SizedBox(width: 8.h),
// // Expanded(child: sickLeave.doctorName!.toText14(weight: FontWeight.w500)),
// // ],
// // ),
// // SizedBox(height: 8.h),
// // Wrap(
// // direction: Axis.horizontal,
// // spacing: 6.h,
// // runSpacing: 6.h,
// // children: [
// // AppCustomChipWidget(
// // labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(sickLeave.appointmentDate), false),
// // ),
// // AppCustomChipWidget(
// // labelText: model.isSickLeavesSortByClinic ? sickLeave.projectName! : sickLeave.clinicName!,
// // ),
// // AppCustomChipWidget(
// // labelText: "${sickLeave.sickLeaveDays} Days",
// // ),
// // ],
// // ),
// // SizedBox(height: 12.h),
// // Row(
// // children: [
// // Expanded(
// // flex: 6,
// // child: CustomButton(
// // text: LocaleKeys.downloadReport.tr(context: context),
// // onPressed: () async {
// // LoaderBottomSheet.showLoader();
// // await medicalFileViewModel.getPatientSickLeavePDF(sickLeave, appState.getAuthenticatedUser()!).then((val) async {
// // LoaderBottomSheet.hideLoader();
// // if (medicalFileViewModel.patientSickLeavePDFBase64.isNotEmpty) {
// // String path = await Utils.createFileFromString(medicalFileViewModel.patientSickLeavePDFBase64, "pdf");
// // try {
// // OpenFilex.open(path);
// // } catch (ex) {
// // debugPrint("Error opening file: $ex");
// // }
// // }
// // });
// // },
// // backgroundColor: AppColors.secondaryLightRedColor,
// // borderColor: AppColors.secondaryLightRedColor,
// // textColor: AppColors.primaryRedColor,
// // fontSize: 14,
// // fontWeight: FontWeight.w500,
// // borderRadius: 12,
// // padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
// // height: 40.h,
// // icon: AppAssets.download,
// // iconColor: AppColors.primaryRedColor,
// // iconSize: 14.h,
// // ),
// // ),
// // ],
// // ),
// // SizedBox(height: 12.h),
// // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
// // SizedBox(height: 12.h),
// // ],
// // );
// // }),
// // ],
// // ),
// // )
// // : SizedBox.shrink(),
// // ),
// ],
// ),
// ),
), ),
),
),
), ),
), ),
) )
: Utils.getNoDataWidget(context, noDataText: LocaleKeys.youDontHaveAnySickLeavesYet.tr(context: context)); : Utils.getNoDataWidget(context, noDataText: LocaleKeys.youDontHaveAnySickLeavesYet.tr(context: context));
}, },
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 24.h),
], ],
); );
}), }),

@ -9,6 +9,7 @@ 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/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/my_invoices/models/get_invoice_details_response_model.dart'; import 'package:hmg_patient_app_new/features/my_invoices/models/get_invoice_details_response_model.dart';
import 'package:hmg_patient_app_new/features/my_invoices/models/get_invoices_list_response_model.dart';
import 'package:hmg_patient_app_new/features/my_invoices/my_invoices_view_model.dart'; import 'package:hmg_patient_app_new/features/my_invoices/my_invoices_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/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
@ -20,8 +21,9 @@ import 'package:provider/provider.dart';
class MyInvoicesDetailsPage extends StatefulWidget { class MyInvoicesDetailsPage extends StatefulWidget {
GetInvoiceDetailsResponseModel getInvoiceDetailsResponseModel; GetInvoiceDetailsResponseModel getInvoiceDetailsResponseModel;
GetInvoicesListResponseModel getInvoicesListResponseModel;
MyInvoicesDetailsPage({super.key, required this.getInvoiceDetailsResponseModel}); MyInvoicesDetailsPage({super.key, required this.getInvoiceDetailsResponseModel, required this.getInvoicesListResponseModel});
@override @override
State<MyInvoicesDetailsPage> createState() => _MyInvoicesDetailsPageState(); State<MyInvoicesDetailsPage> createState() => _MyInvoicesDetailsPageState();
@ -82,6 +84,26 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Wrap(
alignment: WrapAlignment.start,
direction: Axis.horizontal,
spacing: 6.w,
runSpacing: 6.h,
children: [
AppCustomChipWidget(
icon: AppAssets.walkin_appointment_icon,
iconColor: AppColors.textColor,
labelText: LocaleKeys.walkin.tr(context: context),
textColor: AppColors.textColor,
),
AppCustomChipWidget(
labelText: LocaleKeys.outPatient.tr(context: context),
backgroundColor: AppColors.warningColorYellow.withValues(alpha: 0.1),
textColor: AppColors.warningColorYellow,
),
],
),
SizedBox(height: 16.h),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -93,6 +115,29 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
height: 63.h, height: 63.h,
fit: BoxFit.cover, fit: BoxFit.cover,
).circle(100.r), ).circle(100.r),
Transform.translate(
offset: Offset(0.0, -20.h),
child: Container(
width: 40.w,
height: 40.h,
decoration: BoxDecoration(
color: AppColors.whiteColor,
shape: BoxShape.circle, // Makes the container circular
border: Border.all(
color: AppColors.scaffoldBgColor, // Color of the border
width: 1.5.w, // Width of the border
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, applyThemeColor: false),
SizedBox(height: 2.h),
"${widget.getInvoicesListResponseModel.decimalDoctorRate}".toText11(isBold: true, color: AppColors.textColor),
],
),
).circle(100),
),
], ],
), ),
SizedBox(width: 16.w), SizedBox(width: 16.w),
@ -138,41 +183,46 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
), ),
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Container( Row(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( mainAxisSize: MainAxisSize.max,
color: AppColors.whiteColor, children: [
borderRadius: 20.h, Container(
hasShadow: true, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
), color: AppColors.whiteColor,
child: Padding( borderRadius: 20.h,
padding: EdgeInsets.all(14.h), hasShadow: true,
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, child: Padding(
children: [ padding: EdgeInsets.all(14.h),
widget.getInvoiceDetailsResponseModel.listConsultation!.first.procedureName!.toText16(isBold: true), child: Column(
SizedBox(height: 16.h), crossAxisAlignment: CrossAxisAlignment.start,
Wrap(
direction: Axis.horizontal,
spacing: 6.w,
runSpacing: 6.h,
children: [ children: [
AppCustomChipWidget( widget.getInvoiceDetailsResponseModel.listConsultation!.first.procedureName!.toText16(isBold: true),
labelText: "${LocaleKeys.quantity.tr()}: ${widget.getInvoiceDetailsResponseModel.listConsultation!.first.quantity!}", SizedBox(height: 16.h),
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), Wrap(
), direction: Axis.horizontal,
AppCustomChipWidget( spacing: 6.w,
labelText: "${LocaleKeys.price.tr()}: ${widget.getInvoiceDetailsResponseModel.listConsultation!.first.price!} ${LocaleKeys.sar.tr()}", runSpacing: 6.h,
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), children: [
), AppCustomChipWidget(
AppCustomChipWidget( labelText: "${LocaleKeys.quantity.tr()}: ${widget.getInvoiceDetailsResponseModel.listConsultation!.first.quantity!}",
labelText: "${LocaleKeys.total.tr()}: ${widget.getInvoiceDetailsResponseModel.listConsultation!.first.total!} ${LocaleKeys.sar.tr()}", labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), ),
AppCustomChipWidget(
labelText: "${LocaleKeys.price.tr()}: ${widget.getInvoiceDetailsResponseModel.listConsultation!.first.price!} ${LocaleKeys.sar.tr()}",
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
),
AppCustomChipWidget(
labelText: "${LocaleKeys.total.tr()}: ${widget.getInvoiceDetailsResponseModel.listConsultation!.first.total!} ${LocaleKeys.sar.tr()}",
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
),
],
), ),
], ],
), ),
], ),
), ),
), ],
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Container( Container(

@ -86,7 +86,7 @@ class _MyInvoicesListState extends State<MyInvoicesList> {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: MyInvoicesDetailsPage(getInvoiceDetailsResponseModel: myInvoicesVM.invoiceDetailsResponseModel), page: MyInvoicesDetailsPage(getInvoiceDetailsResponseModel: myInvoicesVM.invoiceDetailsResponseModel, getInvoicesListResponseModel: myInvoicesVM.allInvoicesList[index],),
), ),
); );
}, },

@ -47,8 +47,8 @@ class InvoiceListCard extends StatelessWidget {
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: LocaleKeys.outPatient.tr(context: context), labelText: LocaleKeys.outPatient.tr(context: context),
backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.1), backgroundColor: AppColors.warningColorYellow.withValues(alpha: 0.1),
textColor: AppColors.primaryRedColor, textColor: AppColors.warningColorYellow,
), ),
], ],
), ),

@ -114,8 +114,8 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
AppCustomChipWidget( AppCustomChipWidget(
labelText: labelText:
"${getIt.get<AppState>().isArabic() ? widget.prescriptionsResponseModel.isInOutPatientDescriptionN : widget.prescriptionsResponseModel.isInOutPatientDescription}", "${getIt.get<AppState>().isArabic() ? widget.prescriptionsResponseModel.isInOutPatientDescriptionN : widget.prescriptionsResponseModel.isInOutPatientDescription}",
backgroundColor: widget.prescriptionsResponseModel.isInOutPatient! ? AppColors.primaryRedColor.withOpacity(0.1) : AppColors.warningColorYellow.withOpacity(0.1), backgroundColor: AppColors.warningColorYellow.withOpacity(0.1),
textColor: widget.prescriptionsResponseModel.isInOutPatient! ? AppColors.primaryRedColor : AppColors.warningColorYellow, textColor: AppColors.warningColorYellow,
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(

@ -103,14 +103,13 @@ class PrescriptionItemView extends StatelessWidget {
Switch( Switch(
activeColor: AppColors.successColor, activeColor: AppColors.successColor,
activeTrackColor: AppColors.successColor.withValues(alpha: .15), activeTrackColor: AppColors.successColor.withValues(alpha: .15),
// value: isLoading ? false : prescriptionVM.prescriptionDetailsList[index].hasReminder!, value: isLoading ? false : prescriptionVM.prescriptionDetailsList[index].hasReminder!,
value: prescriptionVM.prescriptionDetailsList[index].hasReminder!, // value: prescriptionVM.prescriptionDetailsList[index].hasReminder ?? false,
onChanged: (newValue) async { onChanged: (newValue) async {
CalenderUtilsNew calender = CalenderUtilsNew.instance; CalenderUtilsNew calender = CalenderUtilsNew.instance;
if (await prescriptionVM.checkIfReminderExistForPrescription(index)) { if (await prescriptionVM.checkIfReminderExistForPrescription(index)) {
prescriptionVM.prescriptionDetailsList[index].hasReminder = true; prescriptionVM.prescriptionDetailsList[index].hasReminder = true;
} else {
if (prescriptionVM.prescriptionDetailsList[index].hasReminder ?? false) { if (prescriptionVM.prescriptionDetailsList[index].hasReminder ?? false) {
LoaderBottomSheet.showLoader(loadingText: "Removing Reminders"); LoaderBottomSheet.showLoader(loadingText: "Removing Reminders");
bool resultValue = await calender.checkAndRemoveMultipleItems(id: prescriptionVM.prescriptionDetailsList[index].itemID.toString()); bool resultValue = await calender.checkAndRemoveMultipleItems(id: prescriptionVM.prescriptionDetailsList[index].itemID.toString());
@ -119,7 +118,7 @@ class PrescriptionItemView extends StatelessWidget {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
return; return;
} }
} else {
DateTime startDate = DateTime.now(); DateTime startDate = DateTime.now();
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionVM.prescriptionDetailsList[index].days!.toInt()); DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionVM.prescriptionDetailsList[index].days!.toInt());
BottomSheetUtils().showReminderBottomSheet( BottomSheetUtils().showReminderBottomSheet(

@ -143,9 +143,8 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
AppCustomChipWidget( AppCustomChipWidget(
labelText: labelText:
"${getIt.get<AppState>().isArabic() ? model.patientPrescriptionOrders[index].isInOutPatientDescriptionN : model.patientPrescriptionOrders[index].isInOutPatientDescription}", "${getIt.get<AppState>().isArabic() ? model.patientPrescriptionOrders[index].isInOutPatientDescriptionN : model.patientPrescriptionOrders[index].isInOutPatientDescription}",
backgroundColor: backgroundColor: AppColors.warningColorYellow.withOpacity(0.1),
model.patientPrescriptionOrders[index].isInOutPatient! ? AppColors.primaryRedColor.withOpacity(0.1) : AppColors.warningColorYellow.withOpacity(0.1), textColor: AppColors.warningColorYellow,
textColor: model.patientPrescriptionOrders[index].isInOutPatient! ? AppColors.primaryRedColor : AppColors.warningColorYellow,
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(

@ -169,7 +169,7 @@ class _RadiologyOrdersPageState extends State<RadiologyOrdersPage> {
); );
} }
if (model.patientRadiologyOrdersViewList.isEmpty) { if (model.patientRadiologyOrders.isEmpty) {
return Utils.getNoDataWidget(ctx, noDataText: LocaleKeys.youDontHaveRadiologyOrders.tr(context: context)); return Utils.getNoDataWidget(ctx, noDataText: LocaleKeys.youDontHaveRadiologyOrders.tr(context: context));
} }
@ -393,8 +393,8 @@ class _RadiologyOrdersPageState extends State<RadiologyOrdersPage> {
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
labelText: "${getIt.get<AppState>().isArabic() ? group.isInOutPatientDescriptionN : group.isInOutPatientDescription}", labelText: "${getIt.get<AppState>().isArabic() ? group.isInOutPatientDescriptionN : group.isInOutPatientDescription}",
backgroundColor: group.isInOutPatient! ? AppColors.primaryRedColor.withOpacity(0.1) : AppColors.warningColorYellow.withOpacity(0.1), backgroundColor: AppColors.warningColorYellow.withOpacity(0.1),
textColor: group.isInOutPatient! ? AppColors.primaryRedColor : AppColors.warningColorYellow, textColor: AppColors.warningColorYellow,
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(

Loading…
Cancel
Save