flutter - Flutter Html View 导入时返回错误
问题描述
我已经成功在pubspec.yaml中安装了依赖,退出代码为0。当我import 'package:flutter_html_view/flutter_html_view.dart';
显示它已通过vs代码导入(它强调它是导入但未使用)**
但是当我保存或重新启动我的模拟器时,它会拒绝构建。返回以下错误:
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:326:49: Error: The getter 'children' isn't defined for the class 'InlineSpan'.
- 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
List<TextSpan> children = previous.text.children != null
^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:327:41: Error: The getter 'children' isn't defined for the class 'InlineSpan'.
- 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
? new List.from(previous.text.children)
^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:326:49: Error: The getter 'children' isn't defined for the class 'InlineSpan'.
- 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
List<TextSpan> children = previous.text.children != null
^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:327:41: Error: The getter 'children' isn't defined for the class 'InlineSpan'.
- 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
? new List.from(previous.text.children)
^^^^^^^^```
解决方案
您的 SDK 限制是什么?您使用的是 2018 年的一个非常旧的版本 ( 0.2.0
) package:flutter_markdown
,早在 Flutter 甚至还稳定之前。使用最新的兼容版本(^0.6.2
理想情况下)应该可以解决您的问题。
推荐阅读
- javascript - 无法在 Firefox for Android 中激活 navigator.storage.persist
- spring-boot - HttpServletRequest 返回 emty 阅读器
- html - 如何通过动态更改将电子表格链接到 wordpress?
- javascript - React JS + Azure MVC:进行 API 调用时 POST 404(未找到)
- kotlin - 如何访问 Kotlin 中函数内的主构造函数变量?
- python - 关于网格的 Python tkinter 几何管理
- java - Android Speech to text 后台服务
- android - RecyclerView 和 LiveData
- php - 创建具有相同键检查点的多维 PHP 数组
- ios - 如何从 json 解析成 Core Data 模型,其中有一个带有关联值的枚举?