EntityDeclaration class abstract final

A uniquely identifiable declaration representing a runtime entity.

EntityDeclaration introduces a stable debug identity used for:

  • Equality comparison
  • Hash-based collections
  • Cross-runtime correlation

What Is an Entity?

An entity declaration represents something that:

  • Exists as a distinct runtime symbol
  • Must be uniquely identifiable within the reflection scope

Common examples include:

  • Classes
  • Enums
  • Mixins
  • Top-level functions

Identity & Equality

Equality for EntityDeclaration is not structural.

Two entity declarations are considered equal if and only if:

This ensures:

  • Stable identity across generator runs
  • Correct behavior in caches and registries

Debug Identifier

The debug identifier must:

  • Be globally unique within the runtime
  • Remain stable across reflection lifecycles
  • Not depend on object identity
Inheritance
Implementers

Properties

hashCode → int
The hash code for this object.
no setteroverride
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
getDebugIdentifier() → String
Returns the stable debug identifier for this entity.
getIsPublic() → bool
Indicates whether this declaration is publicly visible.
inherited
getIsSynthetic() → bool
Indicates whether this declaration is synthetic.
inherited
getName() → String
Returns the simple (unqualified) name of this declaration.
inherited
getType() → Type
Returns the Dart Type represented by this declaration.
inherited
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.
override