IDE recognised StoreWatcher Flutter Widget as immutable. Where is that @immutable annotation? It is not in the store_watcher.dart source code.
4
votes
1 Answers
6
votes
The annotation is from the meta package
The docs say
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.
Not all annotation cause the expected feedback yet. Some might need to enable linter rules. For some it might only planned yet to be supported eventually by the analyzer or the linter.
