Target class Null safety

An annotation used on classes that are intended to be used as annotations to indicate the kinds of declarations and directives for which the annotation is appropriate.

The kinds are represented by the constants defined in TargetKind.

Tools, such as the analyzer, can provide feedback if

  • the annotation is associated with anything other than a class, where the class must be usable as an annotation (that is, contain at least one const constructor).
  • the annotated annotation is associated with anything other than the kinds of declarations listed as valid targets.
Annotations
  • @Target(const {TargetKind.classType})

Constructors

Target(Set<TargetKind> kinds)
const

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
kinds Set<TargetKind>
The kinds of declarations with which the annotated annotation can be associated.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited