我的测试无法在我的 Flutter 项目引用的仅 Dart 项目中编译和运行。我收到以下错误消息
Failed to precompile test:test:
../../../../../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.0.0/lib/src/error/best_practices_verifier.dart:1952:14: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
String get displayString {
请问有什么想法吗?Flutter 2.2.1 (current stable channel)
Tools • Dart 2.13.1
(我也在 Flutter 的 github 中问过这个问题)https://github.com/flutter/flutter/issues/83683
最佳答案
有一个使用分析器版本 1.0.0 的组件
升级此组件以使用分析器 1.7 或更高版本似乎可以解决我的问题。
关于Flutter 编译错误 : non-null value must be returned since the return type 'String' doesn't allow null - displayString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67869266/