assignment_to_method
Details about the 'assignment_to_method' diagnostic produced by the Dart analyzer.
Methods can't be assigned a value.
Description
#The analyzer produces this diagnostic when the target of an assignment is a method.
Example
#
The following code produces this diagnostic because f can't be assigned a
value because it's a method:
dart
class C {
void f() {}
void g() {
f = null;
}
}
Common fixes
#Rewrite the code so that there isn't an assignment to a method.
Was this page's content helpful?
除非另有说明,文档之所提及适用于 Dart 3.10.3 版本报告页面问题.