问题标签 [webview-flutter]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
776 浏览

flutter - 在不使用 resizeToAvoidBottomInset 的情况下清除白盒:false

我正在使用 Flutter 和 webview_flutter 包开发应用程序。

使用默认配置,我在屏幕底部得到一个白框。

在此处输入图像描述

当我把这段代码放到脚手架上时:

它消失了:

在此处输入图像描述

但在这种情况下,Webview 在打开虚拟键盘时不会自动调整大小。

在此处输入图像描述

如果我不使用“resizeToAvoidBottomInset:true”它会调整大小,但会出现第一张图片中的白框。

还有其他方法可以清除那个白框吗?

我的代码:

0 投票
1 回答
1392 浏览

html - 如何将字符串中的 HTML 加载到 Flutter 中的 WebView

我有一些 HTML 代码在 String 变量中,而不是在文件中。我想在 WebView 上加载这个 String-HTML

0 投票
0 回答
218 浏览

flutter - 使用 webviews 跨 2 个页面的英雄转换 - Flutter

我正在尝试使用此作为参考( https://www.youtube.com/watch?v=RA-vLF_vnng )在两个 WebViews (相同的 webviews/URL)之间实现 Hero 转换,但该视频只是说我必须用来GlobalKey使这个工作。但是,我没有找到如何使用 webviews 进行此操作的示例,因为我需要将相同的状态放入 2 个不同的小部件中,我发现的示例使用全局键只是为了调用某些方法或从另一个小部件检索一些数据。

有人在 WebView 中使用过 Hero Transitions 吗?

我所有的尝试都以“重复的全局键”或“第二个 webviews 重新加载页面”结尾。

谢谢...

0 投票
1 回答
1235 浏览

flutter - Flutter / webview_flutter 太大而无法适应屏幕

我正在运行颤振 1.17.1,使用 webview_flutter: ^0.3.21 依赖项添加到 pubspec.yaml 并将其添加到 info.plist 的末尾

问题:加载到 webview 的网页太大,手机屏幕放不下。 截屏

这是带有 webview 的代码:

完整应用链接: https ://github.com/bi-samson/mreader

0 投票
1 回答
1844 浏览

android - Flutter WebView window.close() not working (Android)

I cannot close the opened web page using webview flutter with window.close() functionality.

I am using webview_flutter in my application. The website that I've been using has a window.open() function that will open a new window that contains different URL. Inside the new window, there is a close button to close the new window using window.close(). This is working fine when I test it using Browser in my laptop and mobile device, but not working when I tried it on a Flutter application using the above webview plugin.

I am receiving this warning in my logs when I tapped the close button.

Scripts may close only the windows that were opened by it.

I also tried other plugins like flutter_webview_plugin , but no luck as well.

So I'm wondering if this feature for Flutter webview is already available?

Please help me, any suggestions or solutions is highly appreciated. Thank you all in advance!

Update: Packages that I've been tested and still not working

0 投票
0 回答
83 浏览

ios - Flutter 触摸事件通过 Drawer Element 传递到具有嵌入式 WKWebView 的底层 UIKitView

我有一个使用 UIKitView 的插件,其中包含 iOS 上的 WKWebView 和 Android 上带有 WebView 的 AndroidView。Android 解决方案按预期工作,但我在 iOS 上遇到了两个问题。首先,Web 视图的一些内容,例如 HTML 内容,覆盖了 AppBar,其次,我可以通过 Drawer 元素单击鼠标右键,该元素会触发我的 HTML 页面的一些单击事件。通过将插件视图放入 ClipRect 中,我已经能够“解决”第一个问题。

任何想法是什么导致了这种行为以及如何解决它,尤其是第二个?

0 投票
0 回答
698 浏览

flutter - Flutter:限制 webview_flutter 长按手势或打开链接预览

我正在使用 Apache Cordova 中的应用程序,但我无法从使用 Inappbrowser 加载的网站获取 cookie 并保留它们。因此,我切换到能够执行上述功能的颤振。

但是,我希望该应用程序表现得像一个应用程序而不是浏览器。

现在我遇到了这个问题,当用户长按链接时, webview_flutter打开预览弹出窗口操作表。

请让我知道当用户长按链接时是否有办法禁用预览弹出窗口或打开操作表。

我已经实现了我的 Webview,如下所示。

'''

'''

在此处输入图像描述

0 投票
3 回答
3874 浏览

ios - 为什么 webview_flutter 在添加到应用程序(iOS)的情况下不起作用?

所以我试图在单击按钮时打开一个简单的 web 视图。

这是我的 Scaffold 小部件的主体:

有趣的是,当我独立运行这个颤振项目时,它成功地在 iOS 模拟器中打开了 Webview。但是当我将这个颤振模块集成到现有的 iOS 应用程序中时,它不起作用(显示空白屏幕)。为了添加颤振模块,我遵循了这个链接,模块的其他部分工作正常。

我已经在颤振模块的 info.plist 中设置了这个:

我在pubspec.yaml文件中添加了以下版本:

0 投票
2 回答
2100 浏览

flutter - 拉动刷新WebView

我构建了一个 WebView 应用程序,我想下拉屏幕以刷新网页。我将flutter_inappwebview用于webview。我尝试将 WebView 包装在 SingleChildScrollView 或 ListView 中,但它们都不起作用。在下面的代码中,当滑动功能起作用时,WebView 不可滚动。

我一直在寻找解决方案一段时间,但我找不到它。任何帮助将不胜感激!

0 投票
1 回答
835 浏览

ios - webview_flutter 在 iOS 中存档时导致问题

我有一个颤振模块并集成在现有的 iOS 应用程序中(添加到应用程序)。一切正常,但是当我尝试存档时,它会在webview_flutter模块中产生错误:

无法生成位码包,因为“/Users/flutter-module/.ios/Flutter/engine/Flutter.framework/Flutter”是在没有完整位码的情况下构建的。位码的所有框架和 dylib 必须从 Xcode 存档或安装构建文件“/Users/flutter-module/.ios/Flutter/engine/Flutter.framework/Flutter”用于架构 armv7

我检查了构建设置,并且启用的位码设置为“是”,原因很明显,这个错误的原因可能是什么?它与 webview_flutter 模块有关吗?

编辑

macOS:10.15.3(卡特琳娜)

Xcode 版本:11.0 (11A420a)

Flutter 版本:Channel 稳定版,1.20.2