Declaration class abstract final

A named, typed declaration representing a concrete program element.

Declaration extends BaseDeclaration with language-level identity such as name, type, visibility, and synthetic status.


What This Represents

This abstraction is used for:

  • Classes
  • Methods
  • Fields
  • Constructors
  • Parameters

Any declaration that has:

  • A name
  • A Dart type
  • Visibility semantics

Visibility & Origin

Jetleaf distinguishes between:

  • Public vs private declarations
  • User-authored vs synthetic declarations

These distinctions are critical for:

  • Reflection safety
  • Code generation
  • API surface control

Immutability

Implementations must be immutable and thread-safe.

Inheritance
Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

equalizedProperties() → List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
inherited
getIsPublic() → bool
Indicates whether this declaration is publicly visible.
getIsSynthetic() → bool
Indicates whether this declaration is synthetic.
getName() → String
Returns the simple (unqualified) name of this declaration.
getType() → Type
Returns the Dart Type represented by this declaration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize(BinaryBuilder builder) → void
Serializes this declaration to binary format.
inherited
toJson() → Map<String, Object>
Serializes this declaration into a JSON-compatible map.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited