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