update onramperpage webview

This commit is contained in:
Godwin Asuquo 2023-01-06 08:08:36 +01:00
parent b8293ac0ae
commit 3dbf5d8b8c
2 changed files with 12 additions and 11 deletions

View file

@ -75,6 +75,9 @@ class BuyWebViewPageBodyState extends State<BuyWebViewPageBody> {
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));

View file

@ -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<OnRamperPageBody> {
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(),
),
)
);
}
}