diff --git a/lib/services/payments_service.dart b/lib/services/payments_service.dart index c10306f..fc8acb2 100644 --- a/lib/services/payments_service.dart +++ b/lib/services/payments_service.dart @@ -26,13 +26,37 @@ abstract class PaymentService { class PaymentServiceImp implements PaymentService { MyInAppBrowser? myInAppBrowser; - var inAppBrowserOptions = InAppBrowserClassOptions( - inAppWebViewGroupOptions: - InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true, transparentBackground: false), ios: IOSInAppWebViewOptions(applePayAPIEnabled: true)), - crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black), - android: AndroidInAppBrowserOptions(), - ios: - IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN)); + + // var inAppBrowserOptions = InAppBrowserClassOptions( + // inAppWebViewGroupOptions: + // InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true, transparentBackground: false), ios: IOSInAppWebViewOptions(applePayAPIEnabled: true)), + // crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black), + // android: AndroidInAppBrowserOptions(), + // ios: + // IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN)); + + var inAppBrowserOptions = InAppBrowserClassSettings( + webViewSettings: InAppWebViewSettings( + useShouldOverrideUrlLoading: false, + transparentBackground: false, + isInspectable: false, + applePayAPIEnabled: true, + cacheEnabled: false, + ), + browserSettings: InAppBrowserSettings( + hideUrlBar: true, + hideTitleBar: true, + hideDefaultMenuItems: true, + hideToolbarBottom: true, + hideToolbarTop: false, + hideCloseButton: false, + allowGoBackWithBackButton: true, + toolbarBottomBackgroundColor: Colors.black, + closeButtonColor: Colors.white, + presentationStyle: ModalPresentationStyle.FULL_SCREEN, + // toolbarTopBackgroundColor: Colors.black + ), + ); String getUrlRequestByPaymentId({required int id, List? appointmentIds, required PaymentTypes paymentType}) { String urlRequest = ""; @@ -91,7 +115,8 @@ class PaymentServiceImp implements PaymentService { await myInAppBrowser!.openUrlRequest( // Uri.parse(urlRequest) urlRequest: URLRequest(url: WebUri(urlRequest)), - options: inAppBrowserOptions, + settings: inAppBrowserOptions, + // in: inAppBrowserOptions, ); } diff --git a/pubspec.yaml b/pubspec.yaml index 264a106..8d2b33c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: http: ^1.2.2 permission_handler: ^11.3.1 flutter_svg: ^2.0.14 - sizer: any + sizer: ^3.0.4 fluttertoast: ^8.0.8 shared_preferences: ^2.0.6 file_picker: ^8.0.7