Flutter web Webview忽略堆栈,并且在webview本身上方没有任何内容可单击

tv6aics1  于 2023-03-31  发布在  Flutter
关注(0)|答案(1)|浏览(119)

我已经在我的flutter应用程序上使用webview_flutter几个月了,它工作得很好,webview小部件是堆栈小部件的基础,上面有一些其他按钮:

Stack(
          childrens:[
          WebView(
          initialUrl: 'https://flutter.dev',
          ),
                Positioned(
                    top:100,
                    bottom:100
                    child:MaterialButton();
            ),
        Positioned(
            top:200,
            bottom:200
            child:MaterialButton();
    ),
        ]
    );

在这种情况下,它工作正常,AndroidIOS都很好,但是当我通过使用webview_flutter_web切换到Web并在我的main.dart中添加默认Web视图时:

if (kIsWeb) {
    WebView.platform = WebWebViewPlatform();
  } else {
    WebView.platform = AndroidWebView();
  }

Webview本身工作,但它上面的按钮是不可点击的..当点击它是互动像我点击webview本身

m3eecexj

m3eecexj1#

我发布了a similar issue to the flutter github。在webview包中似乎有一个问题。现在,你可以用PointerInterceptor widget Package 小部件。

相关问题