mustBeOverridden top-level constant Null safety
Used to annotate an instance member m
declared on a class or mixin C
.
Indicates that every subclass of C
, concrete or abstract, must directly
override m
.
This annotation places no restrictions on the overriding members. In particular, it does not require that the overriding members invoke the overridden member. The annotation mustCallSuper can be used to add that requirement.
Tools, such as the analyzer, can provide feedback if
- the annotation is associated with anything other than an instance member (a method, operator, field, getter, or setter) of a class or of a mixin, or
- the annotation is associated with a member
m
in class or mixinC
, and there is a class or mixinD
which is a subclass ofC
(directly or indirectly), andD
does not directly declare a concrete override ofm
and does not directly declare a concrete override ofnoSuchMethod
.
Implementation
const _MustBeOverridden mustBeOverridden = _MustBeOverridden();