pull/101/head
haroon amjad 4 months ago
parent b13adde9d2
commit ffca4317aa

@ -161,7 +161,7 @@ class ApiClientImp implements ApiClient {
// body['VersionID'] = ApiConsts.appVersionID.toString(); // body['VersionID'] = ApiConsts.appVersionID.toString();
if (!isExternal) { if (!isExternal) {
body['VersionID'] = "50.0"; body['VersionID'] = ApiConsts.appVersionID.toString();
body['Channel'] = ApiConsts.appChannelId.toString(); body['Channel'] = ApiConsts.appChannelId.toString();
body['IPAdress'] = ApiConsts.appIpAddress; body['IPAdress'] = ApiConsts.appIpAddress;
body['generalid'] = ApiConsts.appGeneralId; body['generalid'] = ApiConsts.appGeneralId;

@ -847,7 +847,7 @@ class ApiConsts {
static final String addAdvanceNumberRequest = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; static final String addAdvanceNumberRequest = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
// ************ static values for Api **************** // ************ static values for Api ****************
static final double appVersionID = 50.0; static final double appVersionID = 19.3;
static final int appChannelId = 3; static final int appChannelId = 3;
static final String appIpAddress = "10.20.10.20"; static final String appIpAddress = "10.20.10.20";
static final String appGeneralId = "Cs2020@2016\$2958"; static final String appGeneralId = "Cs2020@2016\$2958";

@ -75,14 +75,14 @@ class LabViewModel extends ChangeNotifier {
required this.navigationService}); required this.navigationService});
initLabProvider() { initLabProvider() {
if (isLabNeedToLoad) { // if (isLabNeedToLoad) {
patientLabOrders.clear(); patientLabOrders.clear();
filteredLabOrders.clear(); filteredLabOrders.clear();
labOrderTests.clear(); labOrderTests.clear();
isLabOrdersLoading = true; isLabOrdersLoading = true;
isLabResultsLoading = true; isLabResultsLoading = true;
getPatientLabOrders(); getPatientLabOrders();
} // }
notifyListeners(); notifyListeners();
} }
@ -92,7 +92,7 @@ class LabViewModel extends ChangeNotifier {
} }
Future<void> getPatientLabOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientLabOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async {
if (!isLabNeedToLoad) return; // if (!isLabNeedToLoad) return;
isLabOrdersLoading = true; isLabOrdersLoading = true;
patientLabOrders.clear(); patientLabOrders.clear();
@ -158,7 +158,7 @@ class LabViewModel extends ChangeNotifier {
filterSuggestions() { filterSuggestions() {
final List<String> labels = patientLabOrders final List<String> labels = patientLabOrders
.expand((order) => order.testDetails!) .expand((order) => order.testDetails ?? [])
.map((detail) => detail.description) .map((detail) => detail.description)
.whereType<String>() .whereType<String>()
.toList(); .toList();

@ -11,6 +11,7 @@ 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/book_appointments/book_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart';
import 'package:hmg_patient_app_new/features/contact_us/contact_us_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_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/my_appointments/utils/appointment_type.dart'; import 'package:hmg_patient_app_new/features/my_appointments/utils/appointment_type.dart';
@ -22,8 +23,12 @@ import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointmen
import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_doctor_card.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_doctor_card.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/ask_doctor_request_type_select.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/ask_doctor_request_type_select.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart';
import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart';
import 'package:hmg_patient_app_new/presentation/lab/lab_orders_page.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/widgets/lab_rad_card.dart';
import 'package:hmg_patient_app_new/presentation/prescriptions/prescription_detail_page.dart'; import 'package:hmg_patient_app_new/presentation/prescriptions/prescription_detail_page.dart';
import 'package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart'; import 'package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart';
import 'package:hmg_patient_app_new/presentation/radiology/radiology_orders_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/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
@ -50,6 +55,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
late MyAppointmentsViewModel myAppointmentsViewModel; late MyAppointmentsViewModel myAppointmentsViewModel;
late PrescriptionsViewModel prescriptionsViewModel; late PrescriptionsViewModel prescriptionsViewModel;
late BookAppointmentsViewModel bookAppointmentsViewModel; late BookAppointmentsViewModel bookAppointmentsViewModel;
late ContactUsViewModel contactUsViewModel;
@override @override
void initState() { void initState() {
@ -68,6 +74,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false); myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false);
prescriptionsViewModel = Provider.of<PrescriptionsViewModel>(context, listen: false); prescriptionsViewModel = Provider.of<PrescriptionsViewModel>(context, listen: false);
bookAppointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context, listen: false); bookAppointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context, listen: false);
contactUsViewModel = Provider.of<ContactUsViewModel>(context, listen: false);
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
body: Column( body: Column(
@ -75,7 +82,16 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
Expanded( Expanded(
child: CollapsingListView( child: CollapsingListView(
title: "Appointment Details".needTranslation, title: "Appointment Details".needTranslation,
report: AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel) ? () {} : null, report: AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)
? () {
contactUsViewModel.setPatientFeedbackSelectedAppointment(widget.patientAppointmentHistoryResponseModel);
Navigator.of(context).push(
CustomPageRoute(
page: FeedbackPage(),
),
);
}
: null,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -264,203 +280,264 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
], ],
) )
// : SizedBox.shrink() // : SizedBox.shrink()
: Column( : GridView(
crossAxisAlignment: CrossAxisAlignment.start, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
children: [ crossAxisCount: 3,
"Lab & Radiology".needTranslation.toText18(isBold: true), crossAxisSpacing: 16.h,
SizedBox(height: 16.h), mainAxisSpacing: 16.w,
GridView( mainAxisExtent: 115.h,
padding: EdgeInsets.zero, ),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( physics: NeverScrollableScrollPhysics(),
crossAxisCount: isTablet || isFoldable ? 3 : 2, padding: EdgeInsets.zero,
crossAxisSpacing: 13.w, shrinkWrap: true,
mainAxisSpacing: 13.w, children: [
), MedicalFileCard(
physics: NeverScrollableScrollPhysics(), label: "Eye Test Results".needTranslation,
shrinkWrap: true, textColor: AppColors.blackColor,
children: [ backgroundColor: AppColors.whiteColor,
MedicalFileCard( svgIcon: AppAssets.eye_result_icon,
label: LocaleKeys.labResults.tr(context: context), isLargeText: true,
textColor: AppColors.blackColor, iconSize: 36.w,
backgroundColor: AppColors.whiteColor, ).onPress(() {
svgIcon: AppAssets.lab_result_icon, // myAppointmentsViewModel.setIsEyeMeasurementsAppointmentsLoading(true);
iconSize: 40.w, // myAppointmentsViewModel.onEyeMeasurementsTabChanged(0);
isLargeText: true, // myAppointmentsViewModel.getPatientEyeMeasurementAppointments();
), // Navigator.of(context).push(
MedicalFileCard( // CustomPageRoute(
label: "Radiology Results".needTranslation, // page: EyeMeasurementsAppointmentsPage(),
textColor: AppColors.blackColor, // ),
backgroundColor: AppColors.whiteColor, // );
svgIcon: AppAssets.radiology_icon, }),
iconSize: 40.w, MedicalFileCard(
isLargeText: true, label: "Allergy Info".needTranslation,
), textColor: AppColors.blackColor,
], backgroundColor: AppColors.whiteColor,
), svgIcon: AppAssets.allergy_info_icon,
SizedBox(height: 16.h), isLargeText: true,
LocaleKeys.prescriptions.tr().toText18(isBold: true), iconSize: 36.w,
SizedBox(height: 16.h), ),
// Consumer<PrescriptionsViewModel>(builder: (context, prescriptionVM, child) { MedicalFileCard(
// return prescriptionVM.isPrescriptionsDetailsLoading label: "Vaccine Info".needTranslation,
// ? const MoviesShimmerWidget() textColor: AppColors.blackColor,
// : Container( backgroundColor: AppColors.whiteColor,
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration( svgIcon: AppAssets.vaccine_info_icon,
// color: Colors.white, isLargeText: true,
// borderRadius: 20.r, iconSize: 36.w,
// ), ).onPress(() {
// padding: EdgeInsets.all(16.w), // Navigator.of(context).push(
// child: Column( // CustomPageRoute(
// children: [ // page: VaccineListPage(),
// ListView.separated( // ),
// itemCount: prescriptionVM.prescriptionDetailsList.length, // );
// shrinkWrap: true, }),
// padding: EdgeInsets.only(right: 8.w), ],
// physics: NeverScrollableScrollPhysics(), ),
// itemBuilder: (context, index) { // Column(
// return AnimationConfiguration.staggeredList( // crossAxisAlignment: CrossAxisAlignment.start,
// position: index, // children: [
// duration: const Duration(milliseconds: 500), // "Lab & Radiology".needTranslation.toText18(isBold: true),
// child: SlideAnimation( // SizedBox(height: 16.h),
// verticalOffset: 100.0, // Row(
// child: FadeInAnimation( // children: [
// child: Row( // Expanded(
// children: [ // child: LabRadCard(
// Utils.buildSvgWithAssets( // icon: AppAssets.lab_result_icon,
// icon: AppAssets.prescription_item_icon, // labelText: LocaleKeys.labResults.tr(context: context),
// width: 40.h, // // labOrderTests: ["Complete blood count", "Creatinine", "Blood Sugar"],
// height: 40.h, // // labOrderTests: labViewModel.isLabOrdersLoading ? [] : labViewModel.labOrderTests,
// ), // labOrderTests: [],
// SizedBox(width: 8.h), // // isLoading: labViewModel.isLabOrdersLoading,
// Row( // isLoading: false,
// mainAxisSize: MainAxisSize.max, // ).onPress(() {
// children: [ // Navigator.of(context).push(
// Column( // CustomPageRoute(
// children: [ // page: LabOrdersPage(),
// prescriptionVM.prescriptionDetailsList[index].itemDescription! // ),
// .toText12(isBold: true, maxLine: 1), // );
// "Prescribed By: ${widget.patientAppointmentHistoryResponseModel.doctorTitle} ${widget.patientAppointmentHistoryResponseModel.doctorNameObj}" // }),
// .needTranslation // ),
// .toText10( // SizedBox(width: 16.h),
// weight: FontWeight.w500, // Expanded(
// color: AppColors.greyTextColor, // child: LabRadCard(
// letterSpacing: -0.4), // icon: AppAssets.radiology_icon,
// ], // labelText: LocaleKeys.radiology.tr(context: context),
// ), // // labOrderTests: ["Chest X-ray", "Abdominal Ultrasound", "Dental X-ray"],
// SizedBox(width: 68.w), // labOrderTests: [],
// Transform.flip( // isLoading: false,
// flipX: appState.isArabic(), // ).onPress(() {
// child: Utils.buildSvgWithAssets( // Navigator.of(context).push(
// icon: AppAssets.forward_arrow_icon, // CustomPageRoute(
// iconColor: AppColors.blackColor, // page: RadiologyOrdersPage(),
// width: 18.w, // ),
// height: 13.h, // );
// fit: BoxFit.contain, // }),
// ), // ),
// ), // ],
// ], // ),
// ), // SizedBox(height: 16.h),
// ], // LocaleKeys.prescriptions.tr().toText18(isBold: true),
// ), // SizedBox(height: 16.h),
// ), // Consumer<PrescriptionsViewModel>(builder: (context, prescriptionVM, child) {
// ), // return prescriptionVM.isPrescriptionsDetailsLoading
// ); // ? const MoviesShimmerWidget()
// }, // : Container(
// separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), // decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
// ).onPress(() { // color: Colors.white,
// prescriptionVM.setPrescriptionsDetailsLoading(); // borderRadius: 20.r,
// Navigator.of(context).push( // ),
// CustomPageRoute( // padding: EdgeInsets.all(16.w),
// page: PrescriptionDetailPage(prescriptionsResponseModel: getPrescriptionRequestModel()), // child: Column(
// ), // children: [
// ); // // ListView.separated(
// }), // // itemCount: prescriptionVM.prescriptionDetailsList.length,
// SizedBox(height: 16.h), // // shrinkWrap: true,
// const Divider(color: AppColors.dividerColor), // // padding: EdgeInsets.only(right: 8.w),
// SizedBox(height: 16.h), // // physics: NeverScrollableScrollPhysics(),
// Wrap( // // itemBuilder: (context, index) {
// runSpacing: 6.w, // // return AnimationConfiguration.staggeredList(
// children: [ // // position: index,
// // Expanded( // // duration: const Duration(milliseconds: 500),
// // child: CustomButton( // // child: SlideAnimation(
// // text: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? LocaleKeys.resendOrder.tr(context: context) : LocaleKeys.prescriptionDeliveryError.tr(context: context), // // verticalOffset: 100.0,
// // onPressed: () {}, // // child: FadeInAnimation(
// // backgroundColor: AppColors.secondaryLightRedColor, // // child: Row(
// // borderColor: AppColors.secondaryLightRedColor, // // children: [
// // textColor: AppColors.primaryRedColor, // // Utils.buildSvgWithAssets(
// // fontSize: 14, // // icon: AppAssets.prescription_item_icon,
// // fontWeight: FontWeight.w500, // // width: 40.h,
// // borderRadius: 12.h, // // height: 40.h,
// // height: 40.h, // // ),
// // icon: AppAssets.appointment_calendar_icon, // // SizedBox(width: 8.h),
// // iconColor: AppColors.primaryRedColor, // // Row(
// // iconSize: 16.h, // // mainAxisSize: MainAxisSize.max,
// // ), // // children: [
// // ), // // Column(
// // SizedBox(width: 16.h), // // children: [
// Expanded( // // prescriptionVM.prescriptionDetailsList[index].itemDescription!
// child: CustomButton( // // .toText12(isBold: true, maxLine: 1),
// text: "Refill & Delivery".needTranslation, // // "Prescribed By: ${widget.patientAppointmentHistoryResponseModel.doctorTitle} ${widget.patientAppointmentHistoryResponseModel.doctorNameObj}"
// onPressed: () { // // .needTranslation
// Navigator.of(context) // // .toText10(
// .push( // // weight: FontWeight.w500,
// CustomPageRoute( // // color: AppColors.greyTextColor,
// page: PrescriptionsListPage(), // // letterSpacing: -0.4),
// ), // // ],
// ) // // ),
// .then((val) { // // SizedBox(width: 68.w),
// prescriptionsViewModel.setPrescriptionsDetailsLoading(); // // Transform.flip(
// prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel()); // // flipX: appState.isArabic(),
// }); // // child: Utils.buildSvgWithAssets(
// }, // // icon: AppAssets.forward_arrow_icon,
// backgroundColor: AppColors.secondaryLightRedColor, // // iconColor: AppColors.blackColor,
// borderColor: AppColors.secondaryLightRedColor, // // width: 18.w,
// textColor: AppColors.primaryRedColor, // // height: 13.h,
// fontSize: 14.f, // // fit: BoxFit.contain,
// fontWeight: FontWeight.w500, // // ),
// borderRadius: 12.r, // // ),
// height: 40.h, // // ],
// icon: AppAssets.requests, // // ),
// iconColor: AppColors.primaryRedColor, // // ],
// iconSize: 16.h, // // ),
// ), // // ),
// ), // // ),
// // // );
// SizedBox(width: 16.w), // // },
// Expanded( // // separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
// child: CustomButton( // // ).onPress(() {
// text: "All Prescriptions".needTranslation, // // prescriptionVM.setPrescriptionsDetailsLoading();
// onPressed: () { // // Navigator.of(context).push(
// Navigator.of(context) // // CustomPageRoute(
// .push( // // page: PrescriptionDetailPage(prescriptionsResponseModel: getPrescriptionRequestModel()),
// CustomPageRoute( // // ),
// page: PrescriptionsListPage(), // // );
// ), // // }),
// ) // SizedBox(height: 16.h),
// .then((val) { // const Divider(color: AppColors.dividerColor),
// prescriptionsViewModel.setPrescriptionsDetailsLoading(); // SizedBox(height: 16.h),
// prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel()); // // Wrap(
// }); // // runSpacing: 6.w,
// }, // // children: [
// backgroundColor: AppColors.secondaryLightRedColor, // // // Expanded(
// borderColor: AppColors.secondaryLightRedColor, // // // child: CustomButton(
// textColor: AppColors.primaryRedColor, // // // text: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? LocaleKeys.resendOrder.tr(context: context) : LocaleKeys.prescriptionDeliveryError.tr(context: context),
// fontSize: 14.f, // // // onPressed: () {},
// fontWeight: FontWeight.w500, // // // backgroundColor: AppColors.secondaryLightRedColor,
// borderRadius: 12.r, // // // borderColor: AppColors.secondaryLightRedColor,
// height: 40.h, // // // textColor: AppColors.primaryRedColor,
// icon: AppAssets.requests, // // // fontSize: 14,
// iconColor: AppColors.primaryRedColor, // // // fontWeight: FontWeight.w500,
// iconSize: 16.h, // // // borderRadius: 12.h,
// ), // // // height: 40.h,
// ), // // // icon: AppAssets.appointment_calendar_icon,
// ], // // // iconColor: AppColors.primaryRedColor,
// ), // // // iconSize: 16.h,
// ], // // // ),
// ), // // // ),
// ); // // // SizedBox(width: 16.h),
// }), // // Expanded(
], // // child: CustomButton(
), // // text: "Refill & Delivery".needTranslation,
// // onPressed: () {
// // Navigator.of(context)
// // .push(
// // CustomPageRoute(
// // page: PrescriptionsListPage(),
// // ),
// // )
// // .then((val) {
// // prescriptionsViewModel.setPrescriptionsDetailsLoading();
// // prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel());
// // });
// // },
// // backgroundColor: AppColors.secondaryLightRedColor,
// // borderColor: AppColors.secondaryLightRedColor,
// // textColor: AppColors.primaryRedColor,
// // fontSize: 14.f,
// // fontWeight: FontWeight.w500,
// // borderRadius: 12.r,
// // height: 40.h,
// // icon: AppAssets.requests,
// // iconColor: AppColors.primaryRedColor,
// // iconSize: 16.h,
// // ),
// // ),
// //
// // SizedBox(width: 16.w),
// // Expanded(
// // child: CustomButton(
// // text: "All Prescriptions".needTranslation,
// // onPressed: () {
// // Navigator.of(context)
// // .push(
// // CustomPageRoute(
// // page: PrescriptionsListPage(),
// // ),
// // )
// // .then((val) {
// // prescriptionsViewModel.setPrescriptionsDetailsLoading();
// // prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel());
// // });
// // },
// // backgroundColor: AppColors.secondaryLightRedColor,
// // borderColor: AppColors.secondaryLightRedColor,
// // textColor: AppColors.primaryRedColor,
// // fontSize: 14.f,
// // fontWeight: FontWeight.w500,
// // borderRadius: 12.r,
// // height: 40.h,
// // icon: AppAssets.requests,
// // iconColor: AppColors.primaryRedColor,
// // iconSize: 16.h,
// // ),
// // ),
// // ],
// // ),
// ],
// ),
// );
// }),
// ],
// ),
], ],
).paddingAll(24.w), ).paddingAll(24.w),
), ),

File diff suppressed because one or more lines are too long

@ -60,9 +60,7 @@ class LabRadCard extends StatelessWidget {
itemCount: 3, itemCount: 3,
) )
: "You don't have any records yet".needTranslation.toText13( : "You don't have any records yet".needTranslation.toText13(
color: AppColors.greyTextColor, color: AppColors.greyTextColor, isCenter: true),
isCenter: true,
),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

Loading…
Cancel
Save