最近用到webview ,在pub.dev中搜索webview,flutter_webview_plugin的使用率比较高 网上大家发的贴子使用率也高,就导入调试,开始未仔细阅读文档, 需要在页面添加一个弹框,出现以下问题,第一张图为正常显示,第二张图为显示弹框(popwindow/dialog 都试了),在webview上边沿出露出的部分发现弹框有显示 ,但被webview遮挡了。起初以为是布局问题,试了其他布局都无效,此时才去仔细阅读相关文档发现:
Warning: The webview is not integrated in the widget tree, it is a native view on top of the flutter view. You won't be able see snackbars, dialogs, or other flutter widgets that would overlap with the region of the screen taken up by the webview.
WebView并不存在于Widget树中,所以不能在WebView中使用如snackbars、dialogs等这些通知交互Widget
所以大家在选择webview库的时候 要仔细根据自己的需求做选择
flutter_webview_plugin:使用文档网上和官网都有很多 不做记录。后改用webview_media。