File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class WebUnityWidgetView extends StatefulWidget {
18
18
class _WebUnityWidgetViewState extends State <WebUnityWidgetView > {
19
19
final WebViewController _controller = WebViewController ()
20
20
..loadRequest (
21
- Uri .parse ('${Uri . base . origin }/UnityLibrary/index.html' ),
21
+ Uri .parse ('${_getBasePath () }/UnityLibrary/index.html' ),
22
22
);
23
23
24
24
@override
@@ -36,4 +36,10 @@ class _WebUnityWidgetViewState extends State<WebUnityWidgetView> {
36
36
Widget build (BuildContext context) {
37
37
return WebViewWidget (controller: _controller);
38
38
}
39
+
40
+ static String _getBasePath () {
41
+ var prefix = Uri .base .origin+ Uri .base .path;
42
+ if (prefix.endsWith ("/" )) prefix = prefix.substring (0 , prefix.length - 1 );
43
+ return prefix;
44
+ }
39
45
}
You can’t perform that action at this time.
0 commit comments