flutter - Flutter:使用当前 mp_chart 版本构建错误
问题描述
更新旧颤振项目中的所有包后,我无法摆脱关于 mp_charts 的最后两个构建错误
错误:
../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/mp_chart-0.3.1/lib/mp/core/utils/painter_utils.dart:15:34: Error: The getter 'text' isn't defined for the class 'InlineSpan'.
- 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('../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 'text'.
var preText = painter.text.text;
^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/mp_chart-0.3.1/lib/mp/chart/chart.dart:51:12: Error: The method 'then' isn't defined for the class 'FutureOr<dynamic>'.
Try correcting the name to the name of an existing method, or defining a method named 'then'.
.then((value) {
^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\...\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\...\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 18s
Exception: Gradle task assembleDebug failed with exit code 1
pubspec.yaml:
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
http: ^0.13.4
meta: ^1.7.0
flutter_blue: ^0.8.0
flutter_secure_storage: ^4.2.1
path_provider: any
equatable: ^2.0.3
permission_handler: ^8.2.5
url_launcher: ^6.0.12
shared_preferences: ^2.0.8
package_info: ^2.0.2
floor: ^1.2.0
mp_chart: ^0.3.1
tuple: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
floor_generator: ^1.2.0
build_runner: ^2.1.4
flutter:
uses-material-design: true
我找不到可能导致此问题的特定代码部分,最新的 mp_chart 版本一般有问题吗?
解决方案
推荐阅读
- r - 在 Dockerfile 中为 R 添加 CRAN 镜像/PPA
- swift - 奇怪吗?作为 AnyObject 行为
- jpeg - 包含多个 DHT 标记的 JPEG
- python - 使用 Biopython 的 PDBIO 创建 PDB 文件时出现 TypeError,仅限某些文件
- java - DateTimeFormatter 在解析个位数部分时过于严格
- java - 当下拉列表值包含连字符 (-) 与 Apache POI 时 Excel 错误
- javascript - 等待函数响应,然后在 componentDidUpdate 中更改状态
- c# - 从应用程序 c# 发布 windows 的问题
- scala - 当类型参数出现在不变位置时,如何使特征逆变?
- python - 我遇到的解析器错误