pull/52/head
Haroon Amjad 1 month ago
parent 6048b3b5f1
commit 1c2564a1e2

@ -176,8 +176,8 @@ class ApiClientImp implements ApiClient {
body[_appState.isAuthenticated ? 'TokenID' : 'LogInTokenID'] = _appState.appAuthToken; body[_appState.isAuthenticated ? 'TokenID' : 'LogInTokenID'] = _appState.appAuthToken;
} }
// body['TokenID'] = "@dm!n"; body['TokenID'] = "@dm!n";
// body['PatientID'] = 3628599; body['PatientID'] = 3628599;
} }
body.removeWhere((key, value) => value == null); body.removeWhere((key, value) => value == null);

@ -723,7 +723,7 @@ const DEACTIVATE_ACCOUNT = 'Services/Patients.svc/REST/PatientAppleActivation_In
class ApiConsts { class ApiConsts {
static const maxSmallScreen = 660; static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT

@ -98,7 +98,7 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.h, 0.h).onPress(() {
selectedPaymentMethod = "MADA"; selectedPaymentMethod = "MADA";
// openPaymentURL("mada"); openPaymentURL("mada");
}), }),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Container( Container(
@ -137,7 +137,7 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.h, 0.h).onPress(() {
selectedPaymentMethod = "VISA"; selectedPaymentMethod = "VISA";
// openPaymentURL("visa"); openPaymentURL("visa");
}), }),
], ],
), ),
@ -188,7 +188,9 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.h, 0.h).onPress(() {
if (Utils.havePrivilege(103)) { if (Utils.havePrivilege(103)) {
startApplePay(); startApplePay();
} else {} } else {
openPaymentURL("applepay");
}
}) })
: SizedBox(height: 12.h), : SizedBox(height: 12.h),
SizedBox(height: 32.h), SizedBox(height: 32.h),
@ -285,101 +287,137 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
void checkPaymentStatus() async { void checkPaymentStatus() async {
LoaderBottomSheet.showLoader(); LoaderBottomSheet.showLoader();
await payfortViewModel.checkPaymentStatus( await payfortViewModel.checkPaymentStatus(
transactionID: transID, transactionID: transID,
onSuccess: (apiResponse) async { onSuccess: (apiResponse) async {
print(apiResponse.data); print(apiResponse.data);
if (payfortViewModel.payfortCheckPaymentStatusResponseModel!.responseMessage!.toLowerCase() == "success") { if (payfortViewModel.payfortCheckPaymentStatusResponseModel!.responseMessage!.toLowerCase() == "success") {
await habibWalletVM.HISCreateAdvancePayment( await habibWalletVM.HISCreateAdvancePayment(
paymentMethodName: selectedPaymentMethod, paymentMethodName: selectedPaymentMethod,
paidAmount: habibWalletVM.walletRechargeAmount, paidAmount: habibWalletVM.walletRechargeAmount,
paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!, paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!,
patientID: habibWalletVM.fileNumber, patientID: habibWalletVM.fileNumber,
projectID: habibWalletVM.selectedHospital!.iD!, projectID: habibWalletVM.selectedHospital!.iD!,
depositorName: habibWalletVM.depositorName, depositorName: habibWalletVM.depositorName,
onSuccess: (value) async { onSuccess: (value) async {
await habibWalletVM.addAdvanceNumberRequest( await habibWalletVM.addAdvanceNumberRequest(
advanceNumber: Utils.isVidaPlusProject(habibWalletVM.selectedHospital!.iD) advanceNumber: Utils.isVidaPlusProject(habibWalletVM.selectedHospital!.iD)
? value.data['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() ? value.data['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: value.data['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), : value.data['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!, paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!,
onSuccess: (value) { onSuccess: (value) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, context,
child: Utils.getSuccessWidget(loadingText: "Payment Successful!".needTranslation), child: Utils.getSuccessWidget(loadingText: "Payment Successful!".needTranslation),
callBackFunc: () { callBackFunc: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
isFullScreen: false, isFullScreen: false,
isCloseButtonVisible: true, isCloseButtonVisible: true,
); );
}, },
onError: (err) { onError: (err) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, context,
child: Utils.getErrorWidget(loadingText: "Payment Failed - ${err}".needTranslation), child: Utils.getErrorWidget(loadingText: "Payment Failed - ${err}".needTranslation),
callBackFunc: () {}, callBackFunc: () {},
isFullScreen: false, isFullScreen: false,
isCloseButtonVisible: true, isCloseButtonVisible: true,
); );
}); });
}, },
onError: (err) {}); onError: (err) {});
} else {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Payment Failed! Please try again.".needTranslation),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
},
);
}
onBrowserLoadStart(String url) {
print("onBrowserLoadStart");
print(url);
if (selectedPaymentMethod == "tamara") {
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
// tamaraPaymentStatus = uri.queryParameters['status']!;
// tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!;
} else {
Uri uri = new Uri.dataFromString(url);
// tamaraPaymentStatus = uri.queryParameters['paymentStatus']!;
// tamaraOrderID = uri.queryParameters['orderId']!;
}
}
// if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
browser?.close();
MyInAppBrowser.isPaymentDone = true;
return;
}
});
// }
// if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
browser?.close();
MyInAppBrowser.isPaymentDone = false;
return;
}
});
// }
}
onBrowserExit(bool isPaymentMade) async {
print("onBrowserExit Called!!!!");
if (selectedPaymentMethod == "TAMARA") {
// checkTamaraPaymentStatus(transID!, appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// } else {
// updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// }
} else {
checkPaymentStatus();
// checkPaymentStatus(appo);
}
}
openPaymentURL(String paymentMethod) {
browser = MyInAppBrowser(onExitCallback: onBrowserExit, onLoadStartCallback: onBrowserLoadStart, context: context);
transID = Utils.getAdvancePaymentTransID(habibWalletVM.selectedHospital!.iD!, int.parse(habibWalletVM.fileNumber));
// await myAppointmentsViewModel.createAdvancePayment( browser?.openPaymentBrowser(
// paymentMethodName: selectedPaymentMethod, habibWalletVM.walletRechargeAmount,
// projectID: widget.patientAppointmentHistoryResponseModel.projectID, "Advance Payment",
// clinicID: widget.patientAppointmentHistoryResponseModel.clinicID, transID,
// appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(), habibWalletVM.selectedHospital!.iD!.toString(),
// payedAmount: payfortViewModel.payfortCheckPaymentStatusResponseModel!.amount!, "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com",
// paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!, selectedPaymentMethod,
// patientID: "4767477", appState.getAuthenticatedUser()!.patientType.toString(),
// patientType: 1, "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}",
// onSuccess: (value) async { appState.getAuthenticatedUser()!.patientId.toString(),
// print(value); appState.getAuthenticatedUser()!,
// await myAppointmentsViewModel.addAdvanceNumberRequest( browser!,
// advanceNumber: Utils.isVidaPlusProject(widget.patientAppointmentHistoryResponseModel.projectID) false,
// ? value.data['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() "3",
// : value.data['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), "0",
// paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!, context,
// appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(), "",
// onSuccess: (value) async { "",
// if (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!) { "",
// //TODO: Implement LiveCare Check-In API Call "",
// } else { "3");
// await myAppointmentsViewModel.generateAppointmentQR(
// clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
// projectID: widget.patientAppointmentHistoryResponseModel.projectID,
// appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
// isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
// onSuccess: (apiResponse) {
// Future.delayed(Duration(milliseconds: 500), () {
// Navigator.of(context).pop();
// Navigator.pushAndRemoveUntil(
// context,
// CustomPageRoute(
// page: LandingNavigation(),
// ),
// (r) => false);
// Navigator.of(context).push(
// CustomPageRoute(page: MyAppointmentsPage()),
// );
// });
// });
// }
// });
// });
} else {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Payment Failed! Please try again.".needTranslation),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
});
} }
} }

@ -10,6 +10,7 @@ import 'package:hmg_patient_app_new/features/insurance/insurance_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';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.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/shimmer/movies_shimmer_widget.dart'; import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -73,7 +74,7 @@ class InsuranceHistory extends StatelessWidget {
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
"Haroon Amjad".toText16(weight: FontWeight.w600), // "Haroon Amjad".toText16(weight: FontWeight.w600),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Row( Row(
children: [ children: [
@ -82,38 +83,11 @@ class InsuranceHistory extends StatelessWidget {
spacing: 4.h, spacing: 4.h,
runSpacing: 4.h, runSpacing: 4.h,
children: [ children: [
Row( AppCustomChipWidget(
children: [ labelText: "File No.: ${insuranceVM.patientInsuranceCardHistoryList[index].patientID}",
CustomButton(
text: "File No.: 3628599",
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
],
), ),
Row( AppCustomChipWidget(
children: [ labelText: insuranceVM.patientInsuranceCardHistoryList[index].createdOn!,
CustomButton(
text: insuranceVM.patientInsuranceCardHistoryList[index].createdOn!,
// text: "test",
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
],
), ),
], ],
), ),

@ -6,6 +6,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/enums.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/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart'; import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_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/features/lab/lab_view_model.dart'; import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
@ -13,6 +15,7 @@ import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart';
import 'package:hmg_patient_app_new/presentation/lab/search_lab_report.dart'; import 'package:hmg_patient_app_new/presentation/lab/search_lab_report.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/chip/custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'collapsing_list_view.dart'; import 'collapsing_list_view.dart';
@ -65,6 +68,20 @@ class _LabOrdersPageState extends State<LabOrdersPage> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 16.h),
CustomTabBar(
activeTextColor: Color(0xffED1C2B),
activeBackgroundColor: Color(0xffED1C2B).withValues(alpha: .1),
tabs: [
CustomTabBarModel(null, "By Visit".needTranslation),
CustomTabBarModel(null, "By Test".needTranslation),
// CustomTabBarModel(null, "Completed".needTranslation),
],
onTabChange: (index) {
// myAppointmentsViewModel.onTabChange(index);
},
),
SizedBox(height: 16.h),
selectedFilterText!.isNotEmpty selectedFilterText!.isNotEmpty
? CustomChipWidget( ? CustomChipWidget(
chipText: selectedFilterText!, chipText: selectedFilterText!,

@ -13,6 +13,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/appointment_details_page.dart'; import 'package:hmg_patient_app_new/presentation/appointments/appointment_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/buttons/custom_button.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'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
@ -30,20 +31,14 @@ class MedicalFileAppointmentCard extends StatelessWidget {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
CustomButton( AppCustomChipWidget(
text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false), richText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false).toText12().paddingSymmetrical(12.h, 0.h),
onPressed: () {},
backgroundColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.greyColor : AppColors.secondaryLightRedColor,
borderColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.greyLightColor : AppColors.secondaryLightRedColor,
textColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor,
fontSize: 12,
fontWeight: FontWeight.w500,
borderRadius: 12.h,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h,
icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon, icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon,
iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor,
iconSize: 16.h, iconSize: 16.h,
backgroundColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.greyColor : AppColors.secondaryLightRedColor,
textColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor,
padding: EdgeInsets.only(top: 12.h, bottom: 12.h, left: 8.h, right: 8.h),
).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), ).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Container( Container(

@ -62,7 +62,7 @@ class CustomButton extends StatelessWidget {
children: [ children: [
if (icon != null) if (icon != null)
Padding( Padding(
padding: const EdgeInsets.only(right: 8.0), padding: const EdgeInsets.only(right: 8.0, left: 8.0, bottom: 4.5),
child: Utils.buildSvgWithAssets(icon: icon!, iconColor: iconColor, isDisabled: isDisabled, width: iconSize, height: iconSize), child: Utils.buildSvgWithAssets(icon: icon!, iconColor: iconColor, isDisabled: isDisabled, width: iconSize, height: iconSize),
), ),
Text( Text(

@ -23,6 +23,7 @@ class AppCustomChipWidget extends StatelessWidget {
this.deleteIconSize = const Size(12, 12), this.deleteIconSize = const Size(12, 12),
this.deleteIconColor = AppColors.textColor, this.deleteIconColor = AppColors.textColor,
this.deleteIconHasColor = false, this.deleteIconHasColor = false,
this.padding = EdgeInsets.zero,
}); });
final String? labelText; final String? labelText;
@ -38,6 +39,7 @@ class AppCustomChipWidget extends StatelessWidget {
final bool iconHasColor; final bool iconHasColor;
final bool deleteIconHasColor; final bool deleteIconHasColor;
final OutlinedBorder? shape; final OutlinedBorder? shape;
final EdgeInsets? padding;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -50,7 +52,7 @@ class AppCustomChipWidget extends StatelessWidget {
color: Colors.transparent, // Crucially, set color to transparent color: Colors.transparent, // Crucially, set color to transparent
style: BorderStyle.none, style: BorderStyle.none,
), ),
borderRadius: BorderRadius.circular(8.0), // Apply a border radius of 16.0 borderRadius: BorderRadius.circular(10.0), // Apply a border radius of 16.0
), ),
), ),
child: icon.isNotEmpty child: icon.isNotEmpty
@ -67,7 +69,8 @@ class AppCustomChipWidget extends StatelessWidget {
weight: FontWeight.w500, weight: FontWeight.w500,
letterSpacing: -0.64, letterSpacing: -0.64,
color: textColor), color: textColor),
padding: EdgeInsets.all(0.0), // padding: EdgeInsets.all(0.0),
padding: padding,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
labelPadding: EdgeInsets.only( labelPadding: EdgeInsets.only(
left: -4.h, left: -4.h,

@ -55,7 +55,7 @@ dependencies:
uuid: ^4.5.1 uuid: ^4.5.1
health: ^13.1.3 health: ^13.1.3
# health: 12.0.1 # health: 12.0.1
fl_chart: ^1.1.1 fl_chart: ^1.0.0
geolocator: ^14.0.2 geolocator: ^14.0.2
dropdown_search: ^6.0.2 dropdown_search: ^6.0.2
google_maps_flutter: ^2.12.3 google_maps_flutter: ^2.12.3

Loading…
Cancel
Save