AFStandardIDMapRoot<TSubclass, TModel> class
abstract
The superclass used when --add-standard-root is specified on the command line.
The idea is that your state may have a root object like "users" or "todoItems", which is just a mapping of unique identifiers to users or todo items. This superclass provides functionality for accessing and manipulating that map.
- Annotations
Constructors
-
AFStandardIDMapRoot({required Map<
String, TModel> items}) -
const
Properties
-
findAll
→ Iterable<
TModel> -
All the items.
no setter
-
findIds
→ Iterable<
String> -
All the ids of items.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ Map<
String, TModel> -
final
- length → int
-
How many items there are.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
findById(
String id) → TModel? - Find an item with the specified unqieu id.
-
findByIds(
List< String> ids) → Iterable<TModel> - Return a list of items with the specified unique ids.
-
findWhere(
bool fn(TModel e)) → Iterable< TModel> - Find all the items that satisfy somoe criteria.
-
itemId(
TModel item) → String - Access the unique identifier of an item (usually from your persistent store).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reviseAugmentItems(
Iterable< TModel> newItems) → TSubclass - Adds all the items that are not already present, but does not replace existing items.
-
reviseItems(
Map< String, TModel> items) → TSubclass - Replace all the existing items with these new items.
-
reviseRemoveAllItems(
) → TSubclass - Resets the items to empty.
-
reviseRemoveItemById(
String id) → TSubclass - Removes the item with the specified id.
-
reviseRemoveItemsWhere(
bool removeWhere(String, TModel)) → TSubclass - Removes all items for which the callback returns true
-
reviseSetItem(
TModel item) → TSubclass - Add a single item.
-
reviseSetItems(
Iterable< TModel> newItems) → TSubclass - Adds all the items, replacing items that already exist, preserving other items.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited