LinkDeclaration class abstract final

Abstract base class for type references in reflection systems.

Represents a reference to a type declaration, including:

  • Type arguments
  • Pointer information
  • Source location metadata
  • Variance information

{@template link_declaration_features}

Key Features

  • Type parameter resolution
  • Source location tracking
  • Variance awareness
  • Canonical vs reference distinction

Typical Implementations

Used by:

  • Generic type references
  • Type alias resolutions
  • Cross-library type references

Example Usage

final link = getTypeReference<List<String>>();
print(link.getPointerQualifiedName()); // "List"
print(link.getTypeArguments()[0].getName()); // "String"
print(link.getVariance()); // TypeVariance.invariant

{@endtemplate}

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
getCanonicalUri() → Uri?
Gets the canonical definition location.
getIsCanonical() → bool
Checks if this reference points to its canonical definition.
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
getPointerQualifiedName() → String
Gets the fully qualified name of the pointer type.
getPointerType() → Type
Gets the base pointer type being referenced.
getReferenceUri() → Uri?
Gets where this reference was found.
getType() → Type
Returns the Dart Type represented by this declaration.
inherited
getTypeArguments() → List<LinkDeclaration>
Gets the type arguments for this reference.
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.
inherited

Operators

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