Collection<T> class
A collection of items that can be added, removed, and retrieved by ID.
Constructors
Properties
- 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(
String id, T item, {bool override = false}) → void - Adds an item to the collection.
-
all(
) → List< T> - Gets all items in the collection.
-
clear(
) → void - Clears the collection.
-
contains(
String id) → bool - Checks if the collection contains an item with the given ID.
-
forEach(
void f(T)) → void - Iterates over all items in the collection.
-
get(
String id) → T? - Gets an item from the collection by its ID.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String id) → void - Removes an item from the collection.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited