protected top-level constant

const protected = const _Protected()

Used to annotate an instance member (method, getter, setter, operator, or field) m in a class C. If the annotation is on a field it applies to the getter, and setter if appropriate, that are induced by the field. Indicates that m should only be invoked from instance methods of C or classes that extend, implement or mix in C, either directly or indirectly. Additionally indicates that m should only be invoked on this, whether explicitly or implicitly.

Tools, such as the analyzer, can provide feedback if

  • the annotation is associated with anything other than an instance member, or
  • an invocation of a member that has this annotation is used outside of an instance member defined on a class that extends or mixes in the class in which the protected member is defined, or that uses a receiver other than this.


const _Protected protected = const _Protected()