我正在尝试在我的项目中使用 dart(超参数)的新功能,但每次构建都失败。
这是我迁移后的代码:
class ChildClass extends ParentClass {
int? paramOne;
String? paramTwo;
ChildClass({
this.paramOne,
this.paramTwo,
super.paramThree,
super.paramFour,
});
// ...
这是错误消息:
[ ] dart_project/lib/src/model/app_model.dart:407:5: Error: The 'super-parameters' language feature is disabled for this library.
[ +1 ms] Try removing the package language version or setting the language version to 2.17 or higher.
[ ] super.paramThree,
[ ] ^^^^^
pubsec.yaml:
environment:
sdk: '>=2.17.0 <3.0.0'
您可以运行flutter clean
以清除缓存,然后运行flutter pub get
它将获取所有没有缓存的依赖项。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句