PropertyIndication constructor

PropertyIndication(
  1. String name,
  2. DartType type, [
  3. Element? element
])

Creates a new PropertyIndication instance.

Typically constructed internally by the ProxyGenerator during class scanning.

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

Implementation

PropertyIndication(this.name, this.type, [this.element]);