颤动不可变 class?
Flutter immutable class?
IDE 认为 StoreWatcher
Flutter Widget 是不可变的。 @immutable
注释在哪里?它不在 store_watcher.dart 源代码中。
注释来自 meta 包
docs说
Used to annotate a class C. Indicates that C and all subtypes of C
must be immutable.
A class is immutable if all of the instance fields of the class,
whether defined directly or inherited, are final.
Tools, such as the analyzer, can provide feedback if
the annotation is associated with anything other than a class, or a
class that has this annotation or extends, implements or mixes in a
class that has this annotation is not immutable.
并非所有注释都会引起预期的反馈。
有些可能需要启用 linter 规则。
对于某些人来说,它可能只是计划最终由分析器或 linter 支持。
IDE 认为 StoreWatcher
Flutter Widget 是不可变的。 @immutable
注释在哪里?它不在 store_watcher.dart 源代码中。
注释来自 meta 包
docs说
Used to annotate a class C. Indicates that C and all subtypes of C must be immutable.
A class is immutable if all of the instance fields of the class, whether defined directly or inherited, are final.
Tools, such as the analyzer, can provide feedback if
the annotation is associated with anything other than a class, or a class that has this annotation or extends, implements or mixes in a class that has this annotation is not immutable.
并非所有注释都会引起预期的反馈。 有些可能需要启用 linter 规则。 对于某些人来说,它可能只是计划最终由分析器或 linter 支持。