|
|
|
|
@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
|
|
|
|
@ -37,7 +38,7 @@ class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvance
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
browser = new InAppBrowser();
|
|
|
|
|
// browser = new InAppBrowser(onLoadStartCallback: onBrowserLoadStart);
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -223,6 +224,24 @@ class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvance
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onBrowserLoadStart(String url) {
|
|
|
|
|
MyInAppBrowser.successURLS.forEach((element) {
|
|
|
|
|
if (url.contains(element)) {
|
|
|
|
|
if (browser.isOpened()) browser.close();
|
|
|
|
|
MyInAppBrowser.isPaymentDone = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
MyInAppBrowser.errorURLS.forEach((element) {
|
|
|
|
|
if (url.contains(element)) {
|
|
|
|
|
if (browser.isOpened()) browser.close();
|
|
|
|
|
MyInAppBrowser.isPaymentDone = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getInPatientPaymentLink(bool isCopy) {
|
|
|
|
|
ClinicListService service = new ClinicListService();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
@ -243,6 +262,7 @@ class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvance
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
|
String paymentLink = res["PaymentUrl"];
|
|
|
|
|
print(paymentLink);
|
|
|
|
|
if (isCopy) {
|
|
|
|
|
Share.share(paymentLink);
|
|
|
|
|
} else {
|
|
|
|
|
|