From 3dbf5d8b8cb49bd47c755c523fcfe251bb54f80b Mon Sep 17 00:00:00 2001 From: Godwin Asuquo Date: Fri, 6 Jan 2023 08:08:36 +0100 Subject: [PATCH] update onramperpage webview --- lib/src/screens/buy/buy_webview_page.dart | 3 +++ lib/src/screens/buy/onramper_page.dart | 20 +++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/src/screens/buy/buy_webview_page.dart b/lib/src/screens/buy/buy_webview_page.dart index 3c6089c19..c51aaee83 100644 --- a/lib/src/screens/buy/buy_webview_page.dart +++ b/lib/src/screens/buy/buy_webview_page.dart @@ -75,6 +75,9 @@ class BuyWebViewPageBodyState extends State { Widget build(BuildContext context) { return InAppWebView( key: _webViewkey, + initialOptions: InAppWebViewGroupOptions( + crossPlatform: InAppWebViewOptions(transparentBackground: true), + ), initialUrlRequest: URLRequest(url: Uri.tryParse(widget.url ?? '')), onWebViewCreated: (InAppWebViewController controller) => setState(() => _webViewController = controller)); diff --git a/lib/src/screens/buy/onramper_page.dart b/lib/src/screens/buy/onramper_page.dart index b766fd388..1eb052f74 100644 --- a/lib/src/screens/buy/onramper_page.dart +++ b/lib/src/screens/buy/onramper_page.dart @@ -4,8 +4,8 @@ import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cw_core/wallet_base.dart'; import 'package:flutter/material.dart'; -import 'package:webview_flutter/webview_flutter.dart'; import 'package:cake_wallet/.secrets.g.dart' as secrets; +import 'package:flutter_inappwebview/flutter_inappwebview.dart'; class OnRamperPage extends BasePage { OnRamperPage({ @@ -70,17 +70,15 @@ class OnRamperPageBody extends StatefulWidget { class OnRamperPageBodyState extends State { OnRamperPageBodyState(); - @override - void initState() { - super.initState(); - if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); - } - @override Widget build(BuildContext context) { - return WebView( - initialUrl: widget.uri.toString(), - backgroundColor: widget.backgroundColor, - javascriptMode: JavascriptMode.unrestricted); + return InAppWebView( + initialOptions: InAppWebViewGroupOptions( + crossPlatform: InAppWebViewOptions(transparentBackground: true), + ), + initialUrlRequest: URLRequest(url: Uri.tryParse(widget.uri.toString(), + ), + ) + ); } }