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
-
- Object
- PropertyStream<
List< T> > - ListPropertyStream
Constructors
-
ListPropertyStream({required Future<
List< future, required JsonStreamParserController parserController, required String propertyPath})T> >
Properties
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