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 {
1818class _WebUnityWidgetViewState extends State <WebUnityWidgetView > {
1919 final WebViewController _controller = WebViewController ()
2020 ..loadRequest (
21- Uri .parse ('${Uri . base . origin }/UnityLibrary/index.html' ),
21+ Uri .parse ('${_getBasePath () }/UnityLibrary/index.html' ),
2222 );
2323
2424 @override
@@ -36,4 +36,10 @@ class _WebUnityWidgetViewState extends State<WebUnityWidgetView> {
3636 Widget build (BuildContext context) {
3737 return WebViewWidget (controller: _controller);
3838 }
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+ }
3945}
You can’t perform that action at this time.
0 commit comments