File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
- import 'package:webview_flutter/webview_flutter.dart' ;
2
+ import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart' ;
3
+ // ignore: unused_import
4
+ import 'package:webview_flutter_web/webview_flutter_web.dart' ; // used indirectly through webview_flutter_platform_interface
3
5
4
6
class WebUnityWidgetView extends StatefulWidget {
5
7
const WebUnityWidgetView ({
@@ -16,9 +18,12 @@ class WebUnityWidgetView extends StatefulWidget {
16
18
}
17
19
18
20
class _WebUnityWidgetViewState extends State <WebUnityWidgetView > {
19
- final WebViewController _controller = WebViewController ()
20
- ..loadRequest (
21
- Uri .parse ('${_getBasePath ()}/UnityLibrary/index.html' ),
21
+ final PlatformWebViewController _controller = PlatformWebViewController (
22
+ const PlatformWebViewControllerCreationParams (),
23
+ )..loadRequest (
24
+ LoadRequestParams (
25
+ uri: Uri .parse ('${_getBasePath ()}/UnityLibrary/index.html' ),
26
+ ),
22
27
);
23
28
24
29
@override
@@ -34,7 +39,9 @@ class _WebUnityWidgetViewState extends State<WebUnityWidgetView> {
34
39
35
40
@override
36
41
Widget build (BuildContext context) {
37
- return WebViewWidget (controller: _controller);
42
+ return PlatformWebViewWidget (
43
+ PlatformWebViewWidgetCreationParams (controller: _controller),
44
+ ).build (context);
38
45
}
39
46
40
47
static String _getBasePath () {
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ dependencies:
19
19
flutter_plugin_android_lifecycle : ^2.0.7
20
20
stream_transform : ^2.0.0
21
21
plugin_platform_interface : ^2.1.2
22
- webview_flutter : ^4.0.0
23
- webview_flutter_web : ^0.2.2
22
+ webview_flutter_web : ^0.2.2+4
23
+ webview_flutter_platform_interface : ^2.0.0
24
24
web : ' >=0.3.0 <2.0.0' # Needs to resolve to >=0.5.0 to use WebAssembly (WASM).
25
25
# ffi: ^1.2.1 // required for windows support
26
26
You can’t perform that action at this time.
0 commit comments