update onramperpage webview
Godwin Asuquo committed
Jan 6, 2023 at 08:08 UTC
3dbf5d8b8cb49bd47c755c523fcfe251bb54f80b
2 files changed
+12
-11
lib/src/screens/buy/buy_webview_page.dart
+3
@@ -75,6 +75,9 @@ class BuyWebViewPageBodyState extends State<BuyWebViewPageBody> {
75
Widget build(BuildContext context) {
76
return InAppWebView(
77
key: _webViewkey,
78
+ initialOptions: InAppWebViewGroupOptions(
79
+ crossPlatform: InAppWebViewOptions(transparentBackground: true),
80
+ ),
81
initialUrlRequest: URLRequest(url: Uri.tryParse(widget.url ?? '')),
82
onWebViewCreated: (InAppWebViewController controller) =>
83
setState(() => _webViewController = controller));
lib/src/screens/buy/onramper_page.dart
+9
-11
@@ -4,8 +4,8 @@ import 'package:cake_wallet/src/screens/base_page.dart';
4
import 'package:cake_wallet/store/settings_store.dart';
5
import 'package:cw_core/wallet_base.dart';
6
import 'package:flutter/material.dart';
7
-import 'package:webview_flutter/webview_flutter.dart';
7
import 'package:cake_wallet/.secrets.g.dart' as secrets;
8
+import 'package:flutter_inappwebview/flutter_inappwebview.dart';
9
10
class OnRamperPage extends BasePage {
11
OnRamperPage({
@@ -70,17 +70,15 @@ class OnRamperPageBody extends StatefulWidget {
70
class OnRamperPageBodyState extends State<OnRamperPageBody> {
71
OnRamperPageBodyState();
72
73
- @override
74
- void initState() {
75
- super.initState();
76
- if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
77
- }
78
-
73
@override
74
Widget build(BuildContext context) {
81
- return WebView(
82
- initialUrl: widget.uri.toString(),
83
- backgroundColor: widget.backgroundColor,
84
- javascriptMode: JavascriptMode.unrestricted);
75
+ return InAppWebView(
76
+ initialOptions: InAppWebViewGroupOptions(
77
+ crossPlatform: InAppWebViewOptions(transparentBackground: true),
78
+ ),
79
+ initialUrlRequest: URLRequest(url: Uri.tryParse(widget.uri.toString(),
80
+ ),
81
+ )
82
+ );
83
}
84
}