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
相关推荐
大菠萝学姐3 分钟前
基于springboot的旅游攻略网站设计与实现
前端·javascript·vue.js·spring boot·后端·spring·旅游
心随雨下15 分钟前
TypeScript中extends与implements的区别
前端·javascript·typescript
摇滚侠19 分钟前
Vue 项目实战《尚医通》,底部组件拆分与静态搭建,笔记05
前端·vue.js·笔记·vue
双向3319 分钟前
CANN训练营实战指南:从算子分析到核函数定义的完整开发流程
前端
caleb_52020 分钟前
vue cli的介绍
前端·javascript·vue.js
Swift社区21 分钟前
如何监测 Vue + GeoScene 项目中浏览器内存变化并优化性能
前端·javascript·vue.js
WYiQIU24 分钟前
大厂前端岗重复率极高的场景面试原题解析
前端·javascript·vue.js·react.js·面试·状态模式
IT_陈寒43 分钟前
Redis 高并发实战:我从 5000QPS 优化到 5W+ 的7个核心策略
前端·人工智能·后端
vortex51 小时前
ASP vs ASP.NET vs ASP.NET Core:三代微软 Web 技术核心区别解析
前端·microsoft·asp.net
Apifox1 小时前
如何在 Apifox 中使用「模块」合理地组织接口
前端·后端·测试