JIRA Fixes

merge-update-with-lab-changes
Aamir Muhammad 2 years ago
parent 0e04012219
commit b6d222a7ea

@ -10,7 +10,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
class H2OService extends BaseService { class H2OService extends BaseService {
List<UserProgressForTodayDataModel> userProgressForTodayDataList = []; List<UserProgressForTodayDataModel> userProgressForTodayDataList = [];
List<UserProgressForWeekDataModel> userProgressForWeekDataList =[]; List<UserProgressForWeekDataModel> userProgressForWeekDataList = [];
List<UserProgressForMonthDataModel> userProgressForMonthDataList = []; List<UserProgressForMonthDataModel> userProgressForMonthDataList = [];
UserProgressRequestModel userProgressRequestModel = UserProgressRequestModel(); UserProgressRequestModel userProgressRequestModel = UserProgressRequestModel();
@ -23,7 +23,11 @@ class H2OService extends BaseService {
hasError = false; hasError = false;
await baseAppClient.post(H2O_GET_USER_DETAIL, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(H2O_GET_USER_DETAIL, onSuccess: (dynamic response, int statusCode) {
userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]); if (response["UserDetailData_New"] != null) {
userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]);
} else {
userDetailModel = UserDetailModel();
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -28,7 +28,8 @@ class CMCService extends BaseService {
hasError = false; hasError = false;
// RC IMPLEMENTATION // RC IMPLEMENTATION
await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isAllowAny: true, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + authenticatedUserObject.user.patientID.toString(), isRCService: true, isAllowAny: true,
onSuccess: (dynamic response, int statusCode) {
cmcAllServicesList.clear(); cmcAllServicesList.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));

@ -6,15 +6,12 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/PayfortEnums.dart'; import 'package:diplomaticquarterapp/core/enum/PayfortEnums.dart';
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart'; import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
@ -34,7 +31,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_svg/flutter_svg.dart';
class AnicllaryOrdersDetails extends StatefulWidget { class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo; final dynamic appoNo;
@ -51,7 +47,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
late ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
bool _agreeTerms = false; bool _agreeTerms = false;
String selectedPaymentMethod = ""; String selectedPaymentMethod = "";
MyInAppBrowser? browser; late MyInAppBrowser browser;
String transID = ""; String transID = "";
late BuildContext localContext; late BuildContext localContext;
String? selectedInstallmentPlan; String? selectedInstallmentPlan;
@ -483,7 +479,6 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
return total.toStringAsFixed(2); return total.toStringAsFixed(2);
} }
bool checkIfProcedureSelected(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) { bool checkIfProcedureSelected(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if (selectedProcList.length > 0) { if (selectedProcList.length > 0) {
if (selectedProcList.contains(ancillaryOrderProcDetailsList)) { if (selectedProcList.contains(ancillaryOrderProcDetailsList)) {
@ -495,6 +490,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
return false; return false;
} }
} }
bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) { bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if ((ancillaryOrderProcDetailsList.isApprovalRequired! && !ancillaryOrderProcDetailsList.isApprovalCreated!) || if ((ancillaryOrderProcDetailsList.isApprovalRequired! && !ancillaryOrderProcDetailsList.isApprovalCreated!) ||
(ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0) || (ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0) ||
@ -504,6 +500,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
return false; return false;
} }
} }
addToSelectedProcedures() { addToSelectedProcedures() {
if (_ancillaryProcLists.isNotEmpty) { if (_ancillaryProcLists.isNotEmpty) {
selectedProcList.clear(); selectedProcList.clear();
@ -594,10 +591,10 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
if (projectViewModel.havePrivilege(103)) { if (projectViewModel.havePrivilege(103)) {
startApplePay(); startApplePay();
} else { } else {
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), selectedInstallmentPlan);
} }
} else { } else {
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), selectedInstallmentPlan);
} }
}, },
patientShare: double.parse(getTotalValue()), patientShare: double.parse(getTotalValue()),
@ -693,7 +690,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID!); transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID!);
browser!.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"Ancillary Orders Payment", "Ancillary Orders Payment",
transID, transID,
@ -704,7 +701,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
projectViewModel.user.patientID, projectViewModel.user.patientID,
authenticatedUser, authenticatedUser,
browser!, browser,
false, false,
"3", "3",
// Need to get new Service ID from Ayman for Ancillary Tamara // Need to get new Service ID from Ayman for Ancillary Tamara
@ -735,7 +732,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser!.isOpened()) browser!.close(); if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = true; MyInAppBrowser.isPaymentDone = true;
return; return;
} }
@ -743,7 +740,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
MyInAppBrowser.errorURLS.forEach((element) { MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser!.isOpened()) browser!.close(); if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = false; MyInAppBrowser.isPaymentDone = false;
return; return;
} }
@ -881,8 +878,4 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false); Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
}).showAlertDialog(context); }).showAlertDialog(context);
} }
} }

@ -31,7 +31,6 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/shared_pref_kay.dart'; import '../../config/shared_pref_kay.dart';
@ -42,7 +41,7 @@ class BookSuccess extends StatefulWidget {
DoctorList docObject; DoctorList docObject;
late MyInAppBrowser browser; late MyInAppBrowser browser;
final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); // final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser());
String appoDateFormatted; String appoDateFormatted;
String appoTimeFormatted; String appoTimeFormatted;
@ -70,9 +69,7 @@ class _BookSuccessState extends State<BookSuccess> {
initState() { initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
if (widget.patientShareResponse.isLiveCareAppointment! && if (widget.patientShareResponse.isLiveCareAppointment! &&
(widget.patientShareResponse.patientShareWithTax.toString() == "0" || (widget.patientShareResponse.patientShareWithTax.toString() == "0" || widget.patientShareResponse.patientShareWithTax.toString() == "0.0")) {
widget.patientShareResponse.patientShareWithTax.toString() ==
"0.0")) {
setOnlineCheckInForAppointment(); setOnlineCheckInForAppointment();
} }
}); });
@ -116,26 +113,18 @@ class _BookSuccessState extends State<BookSuccess> {
alignment: Alignment.center, alignment: Alignment.center,
color: CustomColors.green, color: CustomColors.green,
child: Table( child: Table(
border: TableBorder(verticalInside: BorderSide( border: TableBorder(verticalInside: BorderSide(width: 0.5, color: Colors.white)),
width: 0.5, color: Colors.white)),
children: [ children: [
TableRow( TableRow(
children: [ children: [
TableCell(child: _getNormalText(TranslationBase TableCell(child: _getNormalText(TranslationBase.of(context).patientShare)),
.of(context) TableCell(child: _getNormalText(TranslationBase.of(context).patientShareWithTax)),
.patientShare)),
TableCell(child: _getNormalText(TranslationBase
.of(context)
.patientShareWithTax)),
], ],
), ),
TableRow( TableRow(
children: [ children: [
TableCell(child: _getHeadingText("SR " + TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShare.toString())),
widget.patientShareResponse.patientShare.toString())), TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShareWithTax.toString())),
TableCell(child: _getHeadingText("SR " +
widget.patientShareResponse.patientShareWithTax
.toString())),
], ],
), ),
], ],
@ -178,10 +167,7 @@ class _BookSuccessState extends State<BookSuccess> {
return Container( return Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: EdgeInsets.all(14), margin: EdgeInsets.all(14),
height: MediaQuery height: MediaQuery.of(context).size.height * 0.18,
.of(context)
.size
.height * 0.18,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
@ -193,10 +179,7 @@ class _BookSuccessState extends State<BookSuccess> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery minWidth: MediaQuery.of(context).size.width * 0.7,
.of(context)
.size
.width * 0.7,
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: CustomColors.green, backgroundColor: CustomColors.green,
@ -205,10 +188,7 @@ class _BookSuccessState extends State<BookSuccess> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
getAppoQR(context); getAppoQR(context);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).checkinOptions, style: TextStyle(fontSize: 18.0, color: Colors.white)),
.of(context)
.checkinOptions,
style: TextStyle(fontSize: 18.0, color: Colors.white)),
), ),
), ),
), ),
@ -219,10 +199,7 @@ class _BookSuccessState extends State<BookSuccess> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery minWidth: MediaQuery.of(context).size.width * 0.7,
.of(context)
.size
.width * 0.7,
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: Color(0xffc5272d), backgroundColor: Color(0xffc5272d),
@ -232,10 +209,7 @@ class _BookSuccessState extends State<BookSuccess> {
// GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
// getAppoQR(context); // getAppoQR(context);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).done, style: TextStyle(fontSize: 18.0, color: Colors.white)),
.of(context)
.done,
style: TextStyle(fontSize: 18.0, color: Colors.white)),
), ),
), ),
), ),
@ -270,16 +244,9 @@ class _BookSuccessState extends State<BookSuccess> {
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
startPaymentProcess(); startPaymentProcess();
projectViewModel.analytics.appointment projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true);
.pay_now_for_appointment(
appointment_type: 'regular',
doctorDetail: widget.docObject,
payNow: true);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).payNow.toUpperCase(),
.of(context)
.payNow
.toUpperCase(),
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
color: Colors.white, color: Colors.white,
@ -300,17 +267,9 @@ class _BookSuccessState extends State<BookSuccess> {
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
navigateToHome(context); navigateToHome(context);
projectViewModel.analytics.appointment projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false);
.pay_now_for_appointment(
appointment_type: 'regular',
doctorDetail: widget.docObject,
payNow: false);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
.of(context)
.payLater
.toUpperCase(), style: TextStyle(
fontSize: 18.0, color: Colors.white)),
), ),
), ),
), ),
@ -318,37 +277,33 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
widget.isCash widget.isCash
? Column( ? Column(
children: [ children: [
mHeight(10.0), mHeight(10.0),
Text( Text(
TranslationBase TranslationBase.of(context).cashAmountUpdateInsurance,
.of(context) style: TextStyle(
.cashAmountUpdateInsurance, fontSize: 14.0,
style: TextStyle( fontWeight: FontWeight.w600,
fontSize: 14.0, color: Color(0xff2E303A),
fontWeight: FontWeight.w600, ),
color: Color(0xff2E303A), ),
), mHeight(5.0),
), DefaultButton(
mHeight(5.0), TranslationBase.of(context).updateInsuranceText,
DefaultButton( () {
TranslationBase Navigator.pop(context, null);
.of(context) Navigator.pushAndRemoveUntil(
.updateInsuranceText, context,
() { MaterialPageRoute(builder: (context) => LandingPage()),
Navigator.pop(context, null); (Route<dynamic> route) => false,
Navigator.pushAndRemoveUntil( );
context, Navigator.push(context, FadePage(page: InsuranceUpdate()));
MaterialPageRoute(builder: (context) => LandingPage()), },
(Route<dynamic> route) => false, color: Color(0xffEAA118),
); textColor: Colors.white,
Navigator.push(context, FadePage(page: InsuranceUpdate())); ),
}, ],
color: Color(0xffEAA118), )
textColor: Colors.white,
),
],
)
: Container(), : Container(),
], ],
), ),
@ -380,23 +335,17 @@ class _BookSuccessState extends State<BookSuccess> {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID; appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID; appo.projectID = widget.docObject.projectID;
appo.appointmentNo = appo.appointmentNo = widget.patientShareResponse.appointmentNo;
widget.patientShareResponse.appointmentNo;
appo.serviceID = widget.patientShareResponse.serviceID; appo.serviceID = widget.patientShareResponse.serviceID;
appo.isLiveCareAppointment = appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID; appo.doctorID = widget.patientShareResponse.doctorID;
appo.appointmentDate = appo.appointmentDate = widget.patientShareResponse.appointmentDate;
widget.patientShareResponse.appointmentDate;
if (appo.isLiveCareAppointment!) if (appo.isLiveCareAppointment!)
insertLiveCareVIDARequest(appo); insertLiveCareVIDARequest(appo);
else else
navigateToHome(context); navigateToHome(context);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).confirmLater, style: TextStyle(fontSize: 16.0, color: Colors.white)),
.of(context)
.confirmLater,
style: TextStyle(fontSize: 16.0, color: Colors.white)),
), ),
), ),
), ),
@ -415,11 +364,9 @@ class _BookSuccessState extends State<BookSuccess> {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID; appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID; appo.projectID = widget.docObject.projectID;
appo.appointmentNo = appo.appointmentNo = widget.patientShareResponse.appointmentNo;
widget.patientShareResponse.appointmentNo;
appo.serviceID = widget.patientShareResponse.serviceID; appo.serviceID = widget.patientShareResponse.serviceID;
appo.isLiveCareAppointment = appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID; appo.doctorID = widget.patientShareResponse.doctorID;
if (appo.isLiveCareAppointment!) { if (appo.isLiveCareAppointment!) {
navigateToHome(context); navigateToHome(context);
@ -427,13 +374,7 @@ class _BookSuccessState extends State<BookSuccess> {
confirmAppointment(appo); confirmAppointment(appo);
} }
}, },
child: Text(widget.patientShareResponse.isLiveCareAppointment! child: Text(widget.patientShareResponse.isLiveCareAppointment! ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm,
? TranslationBase
.of(context)
.confirmLiveCare
: TranslationBase
.of(context)
.confirm,
style: TextStyle(fontSize: 16.0, color: Colors.white)), style: TextStyle(fontSize: 16.0, color: Colors.white)),
), ),
), ),
@ -503,10 +444,7 @@ class _BookSuccessState extends State<BookSuccess> {
Container( Container(
margin: EdgeInsets.only(top: 30.0, bottom: 40.0), margin: EdgeInsets.only(top: 30.0, bottom: 40.0),
alignment: Alignment.center, alignment: Alignment.center,
child: Text(TranslationBase child: Text(TranslationBase.of(context).confirmAppo, style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
.of(context)
.confirmAppo,
style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
), ),
Flex( Flex(
direction: Axis.horizontal, direction: Axis.horizontal,
@ -520,14 +458,8 @@ class _BookSuccessState extends State<BookSuccess> {
children: <Widget>[ children: <Widget>[
_getBulletPoint("1"), _getBulletPoint("1"),
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width * 0.8,
.of(context) child: Text(TranslationBase.of(context).upcomingConfirm, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)),
.size
.width * 0.8,
child: Text(TranslationBase
.of(context)
.upcomingConfirm, overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
), ),
], ],
), ),
@ -547,14 +479,8 @@ class _BookSuccessState extends State<BookSuccess> {
children: <Widget>[ children: <Widget>[
_getBulletPoint("2"), _getBulletPoint("2"),
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width * 0.8,
.of(context) child: Text(TranslationBase.of(context).upcomingConfirmMore, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)),
.size
.width * 0.8,
child: Text(TranslationBase
.of(context)
.upcomingConfirmMore, overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
), ),
], ],
), ),
@ -562,8 +488,7 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
], ],
), ),
Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), child: getPaymentMethods()),
child: getPaymentMethods()),
], ],
); );
} }
@ -575,17 +500,13 @@ class _BookSuccessState extends State<BookSuccess> {
setOnlineCheckInForAppointment() { setOnlineCheckInForAppointment() {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.setOnlineCheckInForAppointment( service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID!, projectViewModel.isArabic ? 1 : 2, context).then((res) {
widget.patientShareResponse.appointmentNo.toString(),
widget.patientShareResponse.projectID!,
projectViewModel.isArabic ? 1 : 2, context).then((res) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID; appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID; appo.projectID = widget.docObject.projectID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
appo.serviceID = widget.patientShareResponse.serviceID; appo.serviceID = widget.patientShareResponse.serviceID;
appo.isLiveCareAppointment = appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID; appo.doctorID = widget.patientShareResponse.doctorID;
appo.appointmentDate = widget.patientShareResponse.appointmentDate; appo.appointmentDate = widget.patientShareResponse.appointmentDate;
insertLiveCareVIDARequest(appo, isMoveHome: false); insertLiveCareVIDARequest(appo, isMoveHome: false);
@ -600,9 +521,7 @@ class _BookSuccessState extends State<BookSuccess> {
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.confirmAppointment( service.confirmAppointment(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.isLiveCareAppointment!, context).then((res) {
appo.appointmentNo!, appo.clinicID!, appo.projectID!,
appo.isLiveCareAppointment!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
@ -621,22 +540,12 @@ class _BookSuccessState extends State<BookSuccess> {
}); });
} }
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, {bool isMoveHome = true}) {
{bool isMoveHome = true}) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.insertVIDARequest( .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!,
appo.appointmentNo, Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
appo.clinicID,
appo.projectID,
appo.serviceID,
appo.doctorID,
appo.appointmentDate!,
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
projectViewModel.isArabic ? 1 : 2,
context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -659,9 +568,7 @@ class _BookSuccessState extends State<BookSuccess> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Text( Text(
TranslationBase TranslationBase.of(context).payNowBookSuccess,
.of(context)
.payNowBookSuccess,
style: TextStyle( style: TextStyle(
fontSize: 24.0, fontSize: 24.0,
letterSpacing: -1.44, letterSpacing: -1.44,
@ -669,9 +576,7 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
), ),
Text( Text(
TranslationBase TranslationBase.of(context).neverWait,
.of(context)
.neverWait,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.54, letterSpacing: -0.54,
@ -679,20 +584,15 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
), ),
mHeight(24), mHeight(24),
Text(TranslationBase Text(TranslationBase.of(context).payNowBookSuccesstext1,
.of(context)
.payNowBookSuccesstext1,
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.36, letterSpacing: -0.36,
)), )),
Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()),
child: getPaymentMethods()),
Text( Text(
TranslationBase TranslationBase.of(context).payNowBookSuccesstext2,
.of(context)
.payNowBookSuccesstext2,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
@ -708,29 +608,26 @@ class _BookSuccessState extends State<BookSuccess> {
navigateToPaymentMethod(context, widget.patientShareResponse); navigateToPaymentMethod(context, widget.patientShareResponse);
} }
Future navigateToPaymentMethod(context, Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async {
PatientShareResponse patientShareResponse) async {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientShareResponse.projectID; appo.projectID = widget.patientShareResponse.projectID;
appo.clinicID = widget.patientShareResponse.clinicID; appo.clinicID = widget.patientShareResponse.clinicID;
appo.clinicName = widget.patientShareResponse.clinicName; appo.clinicName = widget.patientShareResponse.clinicName;
appo.projectName = widget.patientShareResponse.projectName; appo.projectName = widget.patientShareResponse.projectName;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
appo.isLiveCareAppointment = appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID; appo.doctorID = widget.patientShareResponse.doctorID;
appo.appointmentDate = widget.patientShareResponse.appointmentDate; appo.appointmentDate = widget.patientShareResponse.appointmentDate;
appo.serviceID = widget.patientShareResponse.serviceID; appo.serviceID = widget.patientShareResponse.serviceID;
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: PaymentMethod( page: PaymentMethod(
onSelectedMethod: (String metohd, onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
[String? selectedInstallmentPlan]) { setState(() {});
setState(() {}); },
}, patientShare: widget.patientShareResponse.patientShareWithTax)))
patientShare: widget.patientShareResponse.patientShareWithTax)))
.then((value) { .then((value) {
selectedPaymentMethod = value[0]; selectedPaymentMethod = value[0];
if (value != null) { if (value != null) {
@ -748,10 +645,8 @@ class _BookSuccessState extends State<BookSuccess> {
}); });
} }
void startApplePay(AppoitmentAllHistoryResultList appo, void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async {
PatientShareResponse patientShareResponse) async { transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
transID = Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo);
print("TransactionID: $transID"); print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -759,10 +654,7 @@ class _BookSuccessState extends State<BookSuccess> {
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest(); ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
PayfortProjectDetailsRespModel? payfortProjectDetailsRespModel; PayfortProjectDetailsRespModel? payfortProjectDetailsRespModel;
await context.read<PayfortViewModel>() await context.read<PayfortViewModel>().getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum()).then((value) {
.getProjectDetailsForPayfort(projectId: appo.projectID,
serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum())
.then((value) {
payfortProjectDetailsRespModel = value!; payfortProjectDetailsRespModel = value!;
}); });
@ -788,8 +680,7 @@ class _BookSuccessState extends State<BookSuccess> {
applePayInsertRequest.liveServiceID = "0"; applePayInsertRequest.liveServiceID = "0";
applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0"; applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = applePayInsertRequest.amount = patientShareResponse.patientShareWithTax.toString();
patientShareResponse.patientShareWithTax.toString();
applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0"; applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0";
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
@ -800,20 +691,15 @@ class _BookSuccessState extends State<BookSuccess> {
applePayInsertRequest.isMobSDK = true; applePayInsertRequest.isMobSDK = true;
applePayInsertRequest.merchantReference = transID; applePayInsertRequest.merchantReference = transID;
applePayInsertRequest.merchantIdentifier = applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel!.merchantIdentifier!;
payfortProjectDetailsRespModel!.merchantIdentifier!;
applePayInsertRequest.commandType = "PURCHASE"; applePayInsertRequest.commandType = "PURCHASE";
applePayInsertRequest.signature = payfortProjectDetailsRespModel!.signature; applePayInsertRequest.signature = payfortProjectDetailsRespModel!.signature;
applePayInsertRequest.accessCode = applePayInsertRequest.accessCode = payfortProjectDetailsRespModel!.accessCode;
payfortProjectDetailsRespModel!.accessCode; applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel!.shaRequest;
applePayInsertRequest.shaRequestPhrase = applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel!.shaResponse;
payfortProjectDetailsRespModel!.shaRequest;
applePayInsertRequest.shaResponsePhrase =
payfortProjectDetailsRespModel!.shaResponse;
applePayInsertRequest.returnURL = ""; applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then(( service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort( await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
@ -842,7 +728,6 @@ class _BookSuccessState extends State<BookSuccess> {
}); });
} }
openPayment(List<String?> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { openPayment(List<String?> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0]; selectedPaymentMethod = paymentMethod[0];
@ -1274,7 +1159,7 @@ class _BookSuccessState extends State<BookSuccess> {
); );
} }
_getTextStyling() { _getTextStyling() {
return TextStyle(fontSize: 14.0, color: Colors.white, letterSpacing: 0.7); return TextStyle(fontSize: 14.0, color: Colors.white, letterSpacing: 0.7);
} }
} }

@ -1,6 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
@ -15,7 +14,6 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -39,7 +37,7 @@ class BookReminderPage extends StatefulWidget {
class _BookReminderPageState extends State<BookReminderPage> { class _BookReminderPageState extends State<BookReminderPage> {
late MyInAppBrowser browser; late MyInAppBrowser browser;
final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); // final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser());
String? selectedTime; String? selectedTime;
bool isSuccessShow = true; bool isSuccessShow = true;
@ -84,7 +82,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
null, null,
null, null,
widget.docObject.nationalityFlagURL ?? "", widget.docObject.nationalityFlagURL ?? "",
widget.docObject.doctorRate?? 0, widget.docObject.doctorRate ?? 0,
null, null,
widget.docObject.noOfPatientsRate ?? 0, widget.docObject.noOfPatientsRate ?? 0,
"", "",
@ -189,20 +187,11 @@ class _BookReminderPageState extends State<BookReminderPage> {
backgroundColor: CustomColors.green, backgroundColor: CustomColors.green,
elevation: 0, elevation: 0,
onPressed: () async { onPressed: () async {
showReminderDialog( showReminderDialog(context, widget.dateTime!, widget.docObject.name!, widget.patientShareResponse.appointmentNo.toString(), widget.appoDateFormatted, widget.appoTimeFormatted,
context, onSuccess: () {
widget.dateTime!, AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
widget.docObject.name!, navigateToBookSuccess(context);
widget.patientShareResponse.appointmentNo.toString(), }, title: null, description: null);
widget.appoDateFormatted,
widget.appoTimeFormatted,
onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
navigateToBookSuccess(context);
},
title: null,
description: null
);
projectViewModel.analytics.appointment.appointment_reminder(true); projectViewModel.analytics.appointment.appointment_reminder(true);
}, },
child: Text(TranslationBase.of(context).yes, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)), child: Text(TranslationBase.of(context).yes, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)),

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
@ -35,14 +37,11 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_map/huawei_map.dart' as hmsMap;
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:map_launcher/map_launcher.dart'; import 'package:map_launcher/map_launcher.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'dart:io';
import 'package:huawei_map/huawei_map.dart' as hmsMap;
class AppointmentActions extends StatefulWidget { class AppointmentActions extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
@ -59,7 +58,7 @@ class AppointmentActions extends StatefulWidget {
class _AppointmentActionsState extends State<AppointmentActions> { class _AppointmentActionsState extends State<AppointmentActions> {
List<AppoDetailsButton> appoButtonsList = []; List<AppoDetailsButton> appoButtonsList = [];
static bool isHuawei =false; static bool isHuawei = false;
late HmsApiAvailability hmsApiAvailability; late HmsApiAvailability hmsApiAvailability;
@override @override
@ -124,7 +123,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE = 'my appointment'; GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE = 'my appointment';
showReminderDialog( showReminderDialog(
context, context,
DateFormat("dd MMM yyyy hh:mm") DateFormat("dd MMM yyyy hh:mm")
.parse(DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate!), widget.projectViewModel!.isArabic) + " " + widget.appo.startTime!), .parse(DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate!), widget.projectViewModel!.isArabic) + " " + widget.appo.startTime!),
//DateUtil.convertStringToDate(widget.appo.appointmentDate), //DateUtil.convertStringToDate(widget.appo.appointmentDate),
widget.appo.doctorNameObj!, widget.appo.doctorNameObj!,
@ -466,7 +465,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
static Future<void> openMap(double latitude, double longitude) async { static Future<void> openMap(double latitude, double longitude) async {
await MapLauncher.showMarker( await MapLauncher.showMarker(
mapType: Platform.isAndroid ? isHuawei == true ? MapType.petal: MapType.google : MapType.apple, mapType: Platform.isAndroid
? isHuawei == true
? MapType.petal
: MapType.google
: MapType.apple,
coords: Coords(latitude, longitude), coords: Coords(latitude, longitude),
title: "Sulaiman Al Habib", title: "Sulaiman Al Habib",
description: "Appointment Location", description: "Appointment Location",
@ -474,7 +477,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
checkIsHuawei() async { checkIsHuawei() async {
if( Platform.isAndroid) { if (Platform.isAndroid) {
await hmsApiAvailability.isHMSAvailable().then((value) { await hmsApiAvailability.isHMSAvailable().then((value) {
isHuawei = value == 0 ? true : false; isHuawei = value == 0 ? true : false;
hmsMap.HuaweiMapInitializer.initializeMap(); hmsMap.HuaweiMapInitializer.initializeMap();
@ -482,28 +485,29 @@ class _AppointmentActionsState extends State<AppointmentActions> {
print(isHuawei); print(isHuawei);
} }
} }
askYourDoc() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2; int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.isAllowedToAskDoctor(widget.appo.doctorID!,languageID, context).then((res) { service.isAllowedToAskDoctor(widget.appo.doctorID!, languageID, context).then((res) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2; int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) { service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['PatientDoctorAppointmentResultList']); print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) { if (res['PatientDoctorAppointmentResultList'].length != 0) {
getCallRequestType(); getCallRequestType();
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed); AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
});
} }
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
});
}
getCallRequestType() { getCallRequestType() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2; int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
@ -526,23 +530,22 @@ class _AppointmentActionsState extends State<AppointmentActions> {
showAskDocRequestDialog(List<AskDocRequestType> requestData) { showAskDocRequestDialog(List<AskDocRequestType> requestData) {
showGeneralDialog( showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5), barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) { transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform( return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity( child: Opacity(
opacity: a1.value, opacity: a1.value,
child: AskDocDialog(requestData: requestData), child: AskDocDialog(requestData: requestData),
), ),
); );
}, },
transitionDuration: Duration(milliseconds: 500), transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true, barrierDismissible: true,
barrierLabel: '', barrierLabel: '',
context: context, context: context,
pageBuilder: (context, animation1, animation2) =>SizedBox()) pageBuilder: (context, animation1, animation2) => SizedBox()).then((value) {
.then((value) {
print("Dialog Closed"); print("Dialog Closed");
print(value); print(value);
if (value != null) { if (value != null) {
@ -625,10 +628,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
context, context,
FadePage( FadePage(
page: ToDo( page: ToDo(
isShowAppBar: true, isShowAppBar: true,
isFromMyAppointments: true, isFromMyAppointments: true,
appointment: widget.appo, appointment: widget.appo,
))); )));
} }
} }
@ -661,7 +664,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
rateAppointment() { rateAppointment() {
widget.browser = new MyInAppBrowser(); widget.browser = new MyInAppBrowser(onExitCallback: () {});
var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1';
print(url); print(url);
launch(url); launch(url);

@ -47,7 +47,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -55,7 +54,7 @@ import 'package:provider/provider.dart';
class ToDo extends StatefulWidget { class ToDo extends StatefulWidget {
PatientShareResponse? patientShareResponse; PatientShareResponse? patientShareResponse;
var languageID; var languageID;
MyInAppBrowser? browser; // MyInAppBrowser? browser;
bool? isShowAppBar = true; bool? isShowAppBar = true;
Function()? onBackClick; Function()? onBackClick;
bool? isFromMyAppointments; bool? isFromMyAppointments;
@ -1089,7 +1088,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
projectViewModel.analytics.todoList.to_do_list_pay_now(appo); projectViewModel.analytics.todoList.to_do_list_pay_now(appo);
} }
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { openPayment(List<String?> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
browser?.openPaymentBrowser( browser?.openPaymentBrowser(
@ -1103,8 +1102,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
authenticatedUser.firstName!, authenticatedUser.firstName!,
authenticatedUser.patientID, authenticatedUser.patientID,
authenticatedUser, authenticatedUser,
widget!.browser!, browser!,
appo.isLiveCareAppointment!, appo.isLiveCareAppointment ?? false,
"2", "2",
appo.isLiveCareAppointment! ? widget.patientShareResponse!.clinicID.toString() : "", appo.isLiveCareAppointment! ? widget.patientShareResponse!.clinicID.toString() : "",
context, context,
@ -1308,7 +1307,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) { addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, transID!, projectViewModel.isArabic ? 1 : 2, context).then((res) { service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, transID!, projectViewModel.isArabic ? 1 : 2, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
getPatientAppointmentHistory(); getPatientAppointmentHistory();
}).catchError((err) { }).catchError((err) {

@ -135,12 +135,12 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0, bottom: 10.0), margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0, bottom: 10.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery.of(context).size.width,
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: Color(0xFFc5272d), backgroundColor: Color(0xFFc5272d),
@ -284,7 +284,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
service.getCovidPassportNumber().then((res) { service.getCovidPassportNumber().then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['Covid19_Certificate_GetPassportList'].length != 0) { if (res['Covid19_Certificate_GetPassportList'].length != 0) {
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] ?? "";
if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false; _isButtonDisabled = false;
} }

@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_new_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_new_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -33,7 +32,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel!.isLogin); List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel!.isLogin);
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(), // onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget1) => AppScaffold( builder: (_, model, widget1) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: false, isShowAppBar: false,

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -6,7 +5,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart';
@ -95,9 +93,9 @@ class DoctorCard extends StatelessWidget {
color: Utils.isHMCProject(projectViewModel, projectID) color: Utils.isHMCProject(projectViewModel, projectID)
? Color(0xff3FACC8) ? Color(0xff3FACC8)
: isLiveCareAppointment !=null && isLiveCareAppointment==true : isLiveCareAppointment != null && isLiveCareAppointment == true
? Color(0xff2E303A) ? Color(0xff2E303A)
: isInOutPatient !=null && isInOutPatient ==false : isInOutPatient != null && isInOutPatient == false
? Color(0xffD02127) ? Color(0xffD02127)
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -112,9 +110,9 @@ class DoctorCard extends StatelessWidget {
? RotatedBox( ? RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Text( child: Text(
isLiveCareAppointment !=null && isLiveCareAppointment==true isLiveCareAppointment != null && isLiveCareAppointment == true
? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach ? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach
: isInOutPatient!=null && isInOutPatient ==false : isInOutPatient != null && isInOutPatient == false
? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach ? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach
: TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach, : TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10),
@ -183,11 +181,11 @@ class DoctorCard extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
MyRichText(isSortByClinic! ? TranslationBase.of(context).branch : TranslationBase.of(context).clinic + ":", subName ??"", projectViewModel!.isArabic), MyRichText(isSortByClinic! ? TranslationBase.of(context).branch : TranslationBase.of(context).clinic + ":", subName ?? "", projectViewModel!.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel!.isArabic), if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).orderNo, billNo ?? "", projectViewModel!.isArabic),
if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel!.isArabic), if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel!.isArabic),
if (rating != null) if (rating != null)
Row( Row(
@ -216,7 +214,8 @@ class DoctorCard extends StatelessWidget {
), ),
half: Icon( half: Icon(
Icons.star_half, Icons.star_half,
color: CustomColors.accentColor, ), color: CustomColors.accentColor,
),
empty: Icon( empty: Icon(
Icons.star_border, Icons.star_border,
color: CustomColors.accentColor, color: CustomColors.accentColor,

@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
@ -44,7 +43,7 @@ class _TimeLineViewState extends State<TimeLineView> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
// selectedDateObj = DateObj(DateTime.august, 2021, 2021.toString()); // selectedDateObj = DateObj(DateTime.august, 2021, 2021.toString());
dateObjs.add(DateObj(0, 0, widget.isArabic ? "الكل" : "All")); dateObjs.add(DateObj(0, 0, widget.isArabic ? "الكل" : "All"));
for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) {
tempList.add(widget.appoitmentAllHistoryResultList[i]); tempList.add(widget.appoitmentAllHistoryResultList[i]);
@ -62,7 +61,7 @@ class _TimeLineViewState extends State<TimeLineView> {
dateObjs = dateObjs.toSet().toList(); dateObjs = dateObjs.toSet().toList();
dateObjs.sort((a, b) => a.month.compareTo(b.month)); dateObjs.sort((a, b) => a.month.compareTo(b.month));
dateObjs.sort((a, b) => a.year.compareTo(b.year)); dateObjs.sort((a, b) => a.year.compareTo(b.year));
logger.d(dateObjs); // logger.d(dateObjs);
for (int i = 0; i < dateObjs.length; i++) { for (int i = 0; i < dateObjs.length; i++) {
print(dateObjs[i].monthYear.toString()); print(dateObjs[i].monthYear.toString());
@ -167,7 +166,6 @@ class _TimeLineViewState extends State<TimeLineView> {
), ),
), ),
) )
: Container() : Container()
], ],
), ),

@ -14,9 +14,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT } enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT }
@ -40,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser {
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS
@ -60,7 +58,7 @@ class MyInAppBrowser extends InAppBrowser {
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled']; static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled'];
final Function? onExitCallback; final Function onExitCallback;
final Function? onLoadStartCallback; final Function? onLoadStartCallback;
final BuildContext? context; final BuildContext? context;
@ -78,7 +76,7 @@ class MyInAppBrowser extends InAppBrowser {
static bool isPaymentDone = false; static bool isPaymentDone = false;
MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback, this.context}); MyInAppBrowser({required this.onExitCallback, this.appo, this.onLoadStartCallback, this.context});
Future onBrowserCreated() async { Future onBrowserCreated() async {
print("\n\nBrowser Created!\n\n"); print("\n\nBrowser Created!\n\n");
@ -89,8 +87,6 @@ class MyInAppBrowser extends InAppBrowser {
if (onLoadStartCallback != null) onLoadStartCallback!(url.toString()); if (onLoadStartCallback != null) onLoadStartCallback!(url.toString());
} }
@override @override
Future onLoadStop(Uri? url) async { Future onLoadStop(Uri? url) async {
print("\n\nStopped $url\n\n"); print("\n\nStopped $url\n\n");
@ -106,8 +102,15 @@ class MyInAppBrowser extends InAppBrowser {
@override @override
void onExit() { void onExit() {
print("\n\nBrowser closed!\n\n"); print("\n\nBrowser closed before!\n\n");
if (onExitCallback != null) onExitCallback!(appo, isPaymentDone); // if (onExitCallback != null) {
try {
onExitCallback(appo, isPaymentDone);
print("\n\nBrowser closed after!\n\n");
} catch (err) {
print(err.toString());
}
// }
} }
@override @override
@ -145,7 +148,8 @@ class MyInAppBrowser extends InAppBrowser {
// await getPatientData(); // await getPatientData();
if (paymentMethod == "ApplePay") { if (paymentMethod == "ApplePay") {
getDeviceToken(); getDeviceToken();
MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); MyChromeSafariBrowser safariBrowser =
new MyChromeSafariBrowser(new MyInAppBrowser(onExitCallback: browser.onExit), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!);
if (context != null) GifLoaderDialogUtils.showMyDialog(context); if (context != null) GifLoaderDialogUtils.showMyDialog(context);
@ -249,7 +253,8 @@ class MyInAppBrowser extends InAppBrowser {
openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID,
AuthenticatedUser authenticatedUser, InAppBrowser browser) { AuthenticatedUser authenticatedUser, InAppBrowser browser) {
this.browser = browser; this.browser = browser;
MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); MyChromeSafariBrowser safariBrowser =
new MyChromeSafariBrowser(new MyInAppBrowser(onExitCallback: browser.onExit), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!);
// getPatientData(); // getPatientData();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) {
if (order.customValuesXml!.contains("ApplePay")) { if (order.customValuesXml!.contains("ApplePay")) {
@ -476,7 +481,7 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
final Function? onLoadStartCallback; final Function? onLoadStartCallback;
AppoitmentAllHistoryResultList? appo; AppoitmentAllHistoryResultList? appo;
MyChromeSafariBrowser(browserFallback, { this.onExitCallback, this.onLoadStartCallback, this.appo}); MyChromeSafariBrowser(browserFallback, {this.onExitCallback, this.onLoadStartCallback, this.appo});
@override @override
void onOpened() { void onOpened() {

Loading…
Cancel
Save