PropertyIndication class

Property Indication

Represents metadata for a single property (field, getter, or setter) discovered during JetLeaf proxy generation.

This class acts as a lightweight descriptor that captures:

  • The name of the property
  • The declared Dart type of the property
  • An optional reference to the Dart element (Element) providing access to annotations, modifiers, or source information.

It is used internally by ProxyGenerator to determine which properties of a class should be forwarded or proxied in the generated subclass. For example, a PropertyIndication instance may correspond to:

class Example {
  final String id;
  int get count => _count;
  set count(int value) => _count = value;
}

During generation, each of these members would produce a corresponding PropertyIndication used to emit proxy forwarding code:

final id = PropertyIndication('id', DartType(String));
final countGetter = PropertyIndication('count', DartType(int));
final countSetter = PropertyIndication('count', DartType(void));

Fields

  • name → Identifier of the property (e.g., 'id')
  • type → The Dart type of the property (e.g., String, int)
  • element → Optional Element from the analyzer providing richer metadata

Usage in Code Generation

The ProxyGenerator collects all PropertyIndications when scanning supertypes, interfaces, and mixins to emit getters and setters like:

@override
String get id => delegate.id;

@override
set count(int value) => delegate.count = value;

See also

  • ProxyGenerator — uses PropertyIndication to generate proxy fields
  • ClassElement — the analyzer class from which these indications derive

Constructors

PropertyIndication(String name, DartType type, [Element? element])
Creates a new PropertyIndication instance.

Properties

element → Element?
The optional analyzer element that declares this property.
final
hashCode int
The hash code for this object.
no setterinherited
name String
The name (identifier) of the property (e.g., 'id', 'count').
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type → DartType
The declared type of the property (e.g., String, int, User).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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