ListPropertyStream<T extends Object?> class

A property stream for JSON array values.

Provides:

  • A future that completes with the full parsed list
  • An onElement callback for reacting to elements as they start parsing
  • Chainable property getters to access list elements

The onElement callback enables "arm the trap" behavior, firing immediately when a new array element is discovered (before it's fully parsed):

final items = parser.getListProperty('items');
items.onElement((element, index) {
  print('Element $index started');
  // Set up subscriptions for this element
});
Inheritance

Constructors

ListPropertyStream({required Future<List<T>> future, required JsonStreamParserController parserController, required String propertyPath})

Properties

future Future<List<T>>
A future that completes with the final parsed value of this property.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getBooleanProperty(String key) BooleanPropertyStream
getListProperty<E extends Object?>(String key, {void onElement(PropertyStream propertyStream, int index)?}) ListPropertyStream<E>
getMapProperty(String key) MapPropertyStream
getNullProperty(String key) NullPropertyStream
getNumberProperty(String key) NumberPropertyStream
getStringProperty(String key) StringPropertyStream
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onElement(void callback(PropertyStream propertyStream, int index)) → void
Registers a callback that fires when each array element starts parsing.
toString() String
A string representation of this object.
inherited

Operators

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