|
|
@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
|
|
|
import 'package:smart_progress_bar/smart_progress_bar.dart';
|
|
|
|
import 'package:smart_progress_bar/smart_progress_bar.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'QRCode.dart';
|
|
|
|
import 'QRCode.dart';
|
|
|
@ -21,6 +22,8 @@ class BookSuccess extends StatefulWidget {
|
|
|
|
DoctorList docObject;
|
|
|
|
DoctorList docObject;
|
|
|
|
|
|
|
|
|
|
|
|
MyInAppBrowser browser;
|
|
|
|
MyInAppBrowser browser;
|
|
|
|
|
|
|
|
final ChromeSafariBrowser chromeBrowser =
|
|
|
|
|
|
|
|
new MyChromeSafariBrowser(new MyInAppBrowser());
|
|
|
|
|
|
|
|
|
|
|
|
String appoDateFormatted;
|
|
|
|
String appoDateFormatted;
|
|
|
|
String appoTimeFormatted;
|
|
|
|
String appoTimeFormatted;
|
|
|
@ -78,12 +81,14 @@ class _BookSuccessState extends State<BookSuccess> {
|
|
|
|
width: 80.0),
|
|
|
|
width: 80.0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.62,
|
|
|
|
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
|
|
|
|
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Text(widget.docObject.projectName,
|
|
|
|
Text(widget.docObject.projectName,
|
|
|
|
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
style: _getTextStyling()),
|
|
|
|
style: _getTextStyling()),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
|
@ -93,6 +98,7 @@ class _BookSuccessState extends State<BookSuccess> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
|
|
|
|
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
|
|
|
|
child: Text(widget.docObject.clinicName,
|
|
|
|
child: Text(widget.docObject.clinicName,
|
|
|
|
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
style: _getTextStyling()),
|
|
|
|
style: _getTextStyling()),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
@ -101,6 +107,7 @@ class _BookSuccessState extends State<BookSuccess> {
|
|
|
|
widget.appoDateFormatted +
|
|
|
|
widget.appoDateFormatted +
|
|
|
|
", " +
|
|
|
|
", " +
|
|
|
|
widget.appoTimeFormatted,
|
|
|
|
widget.appoTimeFormatted,
|
|
|
|
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
style: _getTextStyling()),
|
|
|
|
style: _getTextStyling()),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
@ -110,7 +117,7 @@ class _BookSuccessState extends State<BookSuccess> {
|
|
|
|
widget.docObject.doctorTitle +
|
|
|
|
widget.docObject.doctorTitle +
|
|
|
|
" " +
|
|
|
|
" " +
|
|
|
|
widget.docObject.name,
|
|
|
|
widget.docObject.name,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
style: _getTextStyling()),
|
|
|
|
style: _getTextStyling()),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -295,7 +302,8 @@ class _BookSuccessState extends State<BookSuccess> {
|
|
|
|
appo.appointmentNo =
|
|
|
|
appo.appointmentNo =
|
|
|
|
widget.patientShareResponse.appointmentNo;
|
|
|
|
widget.patientShareResponse.appointmentNo;
|
|
|
|
appo.serviceID = widget.patientShareResponse.serviceID;
|
|
|
|
appo.serviceID = widget.patientShareResponse.serviceID;
|
|
|
|
appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
|
|
|
|
appo.isLiveCareAppointment =
|
|
|
|
|
|
|
|
widget.patientShareResponse.isLiveCareAppointment;
|
|
|
|
appo.doctorID = widget.patientShareResponse.doctorID;
|
|
|
|
appo.doctorID = widget.patientShareResponse.doctorID;
|
|
|
|
confirmAppointment(appo);
|
|
|
|
confirmAppointment(appo);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -341,8 +349,8 @@ class _BookSuccessState extends State<BookSuccess> {
|
|
|
|
confirmAppointment(AppoitmentAllHistoryResultList appo) {
|
|
|
|
confirmAppointment(AppoitmentAllHistoryResultList appo) {
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
service
|
|
|
|
service
|
|
|
|
.confirmAppointment(
|
|
|
|
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID,
|
|
|
|
appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context)
|
|
|
|
appo.isLiveCareAppointment, context)
|
|
|
|
.then((res) {
|
|
|
|
.then((res) {
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
|
|
|
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
|
|
@ -542,7 +550,15 @@ class _BookSuccessState extends State<BookSuccess> {
|
|
|
|
AuthenticatedUser authenticatedUser,
|
|
|
|
AuthenticatedUser authenticatedUser,
|
|
|
|
double amount,
|
|
|
|
double amount,
|
|
|
|
PatientShareResponse patientShareResponse,
|
|
|
|
PatientShareResponse patientShareResponse,
|
|
|
|
AppoitmentAllHistoryResultList appo) {
|
|
|
|
AppoitmentAllHistoryResultList appo) async {
|
|
|
|
|
|
|
|
if (paymentMethod == "ApplePay") {
|
|
|
|
|
|
|
|
await widget.chromeBrowser.open(
|
|
|
|
|
|
|
|
url: "https://flutter.dev/",
|
|
|
|
|
|
|
|
options: ChromeSafariBrowserClassOptions(
|
|
|
|
|
|
|
|
android: AndroidChromeCustomTabsOptions(
|
|
|
|
|
|
|
|
addDefaultShareMenuItem: false),
|
|
|
|
|
|
|
|
ios: IOSSafariOptions(barCollapsingEnabled: true)));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
widget.browser = new MyInAppBrowser(
|
|
|
|
widget.browser = new MyInAppBrowser(
|
|
|
|
onExitCallback: onBrowserExit,
|
|
|
|
onExitCallback: onBrowserExit,
|
|
|
|
appo: appo,
|
|
|
|
appo: appo,
|
|
|
@ -559,6 +575,7 @@ class _BookSuccessState extends State<BookSuccess> {
|
|
|
|
authenticatedUser,
|
|
|
|
authenticatedUser,
|
|
|
|
widget.browser);
|
|
|
|
widget.browser);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onBrowserLoadStart(String url) {
|
|
|
|
onBrowserLoadStart(String url) {
|
|
|
|
print("onBrowserLoadStart");
|
|
|
|
print("onBrowserLoadStart");
|
|
|
@ -608,12 +625,34 @@ class _BookSuccessState extends State<BookSuccess> {
|
|
|
|
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
|
|
|
|
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getApplePayAPQ(AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
|
|
|
service
|
|
|
|
|
|
|
|
.checkPaymentStatus(
|
|
|
|
|
|
|
|
Utils.getAppointmentTransID(
|
|
|
|
|
|
|
|
appo.projectID, appo.clinicID, appo.appointmentNo),
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.then((res) {
|
|
|
|
|
|
|
|
print("Printing Payment Status Reponse!!!!");
|
|
|
|
|
|
|
|
print(res);
|
|
|
|
|
|
|
|
String paymentInfo = res['Response_Message'];
|
|
|
|
|
|
|
|
if (paymentInfo == 'Success') {
|
|
|
|
|
|
|
|
createAdvancePayment(res, appo);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
AppToast.showErrorToast(message: res['Response_Message']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
|
|
|
print(err);
|
|
|
|
|
|
|
|
}).showProgressBar(
|
|
|
|
|
|
|
|
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
|
|
|
|
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
String paymentReference = res['Fort_id'].toString();
|
|
|
|
String paymentReference = res['Fort_id'].toString();
|
|
|
|
service
|
|
|
|
service
|
|
|
|
.createAdvancePayment(
|
|
|
|
.createAdvancePayment(
|
|
|
|
appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
|
|
|
|
appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
|
|
|
|
.then((res) {
|
|
|
|
.then((res) {
|
|
|
|
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
|
|
|
|
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
|
|
|
|
addAdvancedNumberRequest(
|
|
|
|
addAdvancedNumberRequest(
|
|
|
|