GenericList<TItem> class final

A list that associates an arbitrary generic type with each item. When the list is iterated, the list's GenericListHandler will be invoked with the item and its associated generic type.

Use for situations where you have a long-lived list of items that you want to process via their associated generic type.

Constructors

GenericList({required GenericListHandler<TItem> handler})
Creates a new GenericList with the given handler.

Properties

handler GenericListHandler<TItem>
The handler invoked for each item during iteration.
latefinal
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add<TAssociated>(TItem item) → void
Adds an item to the list, associating it with the generic type TAssociated.
iterate() → void
Iterates the list in order, invoking the handler for each item.
iterateInReverse() → void
Iterates the list in reverse order, invoking the handler for each item.
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