我正在学习更多关于测试的知识,我想使用 Mockito Package和 Build Runner Packate然后我在 lib/models/cat.dart 中有我的类 Cat
然后我有我的 lib/test/cat_test.dart 文件来测试 cat 类
这是我的 pubspec.yaml(其中的一部分)
当我想运行下一个命令时抛出问题:
dart run build_runner build
下一个问题是:
Resolving dependencies in /Users/adm/Documents/Things of david/PRACTICAS/Flutter/testing_app... The current Dart SDK version is 2.15.1. Because testing_app requires SDK version >=2.16.1 <3.0.0, version solving failed.
flutter 医生:
非常感谢您的帮助。
最佳答案
答案在错误信息中:
The current Dart SDK version is 2.15.1. Because testing_app requires SDK version >=2.16.1 <3.0.0, version solving failed.
说明项目需要2.16.1版本的Dart SDK(至少),而你的版本是2.15.1。
您应该使用 flutter upgrade
升级您的 Flutter 版本。有关详细信息,请参阅 the documentation .
关于flutter - 因为testing_app需要SDK版本>=2.16.1 <3.0.0,版本解析失败。在 flutter 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71451502/