nonVirtual top-level constant

_NonVirtual const nonVirtual

Used to annotate an instance member (method, getter, setter, operator, or field) m in a class C or mixin M. Indicates that m should not be overridden in any classes that extend or mixin C or M.

Tools, such as the analyzer, can provide feedback if

  • the annotation is associated with anything other than an instance member,
  • the annotation is associated with an abstract member (because subclasses are required to override the member),
  • the annotation is associated with an extension method,
  • the annotation is associated with a member m in class C, and there is a class D or mixin M, that extends or mixes in C, that declares an overriding member m.

Implementation

const _NonVirtual nonVirtual = _NonVirtual();