mustCallSuper top-level constant Null safety

_MustCallSuper const mustCallSuper

Used to annotate an instance method m. Indicates that every invocation of a method that overrides m must also invoke m. In addition, every method that overrides m is implicitly annotated with this same annotation.

Note that private methods with this annotation cannot be validly overridden outside of the library that defines the annotated method.

Tools, such as the analyzer, can provide feedback if

  • the annotation is associated with anything other than an instance method, or
  • a method that overrides a method that has this annotation can return without invoking the overridden method.

Implementation

const _MustCallSuper mustCallSuper = _MustCallSuper();