This looks like a false positive to me because my Flutter App all still builds, and why couldn't I assign a dynamic to a double? But because now literally all of my files are red, I don't want to ignore it. There are also a LOT of other error messages, such as A value of type 'dynamic' can't be assigned to a variable of type 'String'.
, Missing type arguments for generic type 'MaterialPageRoute<dynamic>'.
and many others that still work tho.
An example of code that doensn't work:
class Kpi{
final String name;
final double value;
Kpi({this.type, this.name);
factory Kpi.valuesFromJson(Map<String, dynamic> json) {
return new Kpi(
name: json['Key'],
value: json['Value'].toDouble()
);
}
Here, name and value are red with the errormessage from the title.
Things I tried
- App restart
- Android studio restart
- Flutter clean
- PC (Mac) restart
This happened after tortoise checkouting to an old revision and changing back.
Additionally, a lot of warnings appeard like only using " " if the string has ' ', or this: https://dart-lang.github.io/linter/lints/prefer_const_constructors.html
Flutter Version
Flutter 1.22.1 ? channel stable ? https://github.com/flutter/flutter.git
Framework ? revision f30b7f4db9 (3 months ago) ? 2020-10-08 10:06:30 -0700
Engine ? revision 75bef9f6c8
Tools ? Dart 2.10.1
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…