flutter使用html_editor_enhanced: ^2.6.0后,编辑框无法获取焦点,无法操作

flutter使用html_editor_enhanced: ^2.6.0后,编辑框无法获取焦点,无法操作,报如下错误:

dart 复制代码
PlatformException(error, Unknown feature SUPPRESS_ERROR_PAGE, null, java.lang.RuntimeException: Unknown feature SUPPRESS_ERROR_PAGE
I/flutter (26600): 	at androidx.webkit.internal.WebViewFeatureInternal.isSupported(WebViewFeatureInternal.java:649)
I/flutter (26600): 	at androidx.webkit.internal.WebViewFeatureInternal.isSupported(WebViewFeatureInternal.java:618)
I/flutter (26600): 	at androidx.webkit.WebViewFeature.isFeatureSupported(WebViewFeature.java:611)
I/flutter (26600): 	at com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.InAppWebView.prepare(InAppWebView.java:436)
I/flutter (26600): 	at com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.FlutterWebView.<init>(FlutterWebView.java:82)
I/flutter (26600): 	at com.pichillilorenzo.flutter_inappwebview_android.webview.FlutterWebViewFactory.create(FlutterWebViewFactory.java:67)
I/flutter (26600): 	at io.flutter.plugin.platform.PlatformViewsController.createPlatformView(PlatformViewsController.java:527)
I/flutter (26600): 	at io.flutter.plugin.platform.PlatformViewsController$1.createForPlatformViewLayer(PlatformViewsCo
dart 复制代码
Exception: HTML editor is still loading, please wait before evaluating this JS: $('#summernote-2').summernote('code', '');!
I/flutter (31854): [2025-05-27 17:54:49.996853 | Catcher 2 | INFO] 
I/flutter (31854): [2025-05-27 17:54:49.997095 | Catcher 2 | INFO] ------- STACK TRACE -------
I/flutter (31854): [2025-05-27 17:54:49.997442 | Catcher 2 | INFO] #0      HtmlEditorController._evaluateJavascript (package:html_editor_enhanced/src/html_editor_controller_mobile.dart:261:9)
I/flutter (31854): [2025-05-27 17:54:49.997599 | Catcher 2 | INFO] #1      HtmlEditorController.setText (package:html_editor_enhanced/src/html_editor_controller_mobile.dart:85:5)

错误原因:

html_editor_enhanced中使用的flutter_inappwebview 插件内部调用了 AndroidX WebView 的 SUPPRESS_ERROR_PAGE 特性检测,但你的设备/系统版本的 WebView 不支持这个新特性,导致异常抛出

解决办法:

降低webview_flutter插件的版本

使用如下版本:

dart 复制代码
webview_flutter: ^3.0.0
相关推荐
岁月宁静2 小时前
深度定制:在 Vue 3.5 应用中集成流式 AI 写作助手的实践
前端·vue.js·人工智能
心易行者3 小时前
10天!前端用coze,后端用Trae IDE+Claude Code从0开始构建到平台上线
前端
saadiya~3 小时前
ECharts 实时数据平滑更新实践(含 WebSocket 模拟)
前端·javascript·echarts
fruge3 小时前
前端三驾马车(HTML/CSS/JS)核心概念深度解析
前端·css·html
百锦再3 小时前
Vue Scoped样式混淆问题详解与解决方案
java·前端·javascript·数据库·vue.js·学习·.net
烛阴3 小时前
Lua 模块的完整入门指南
前端·lua
浪里行舟4 小时前
国产OCR双雄对决?PaddleOCR-VL与DeepSeek-OCR全面解析
前端·后端
znhy@1235 小时前
CSS易忘属性
前端·css
瓜瓜怪兽亚5 小时前
前端基础知识---Ajax
前端·javascript·ajax
—Qeyser5 小时前
使用 Flutter 的 Positioned 控件实现精准布局
flutter