DashboardItemStorageDelegate<T extends DashboardItem> class abstract

Dashboard item layout changes stored/handled with the delegate. Keeps the layout in memory, fetches the layout when necessary. It can store different layouts for different slotCounts. Different slotCounts may be required, especially for browser users.

If cacheItems the delegate store layouts from memory.

If layoutsBySlotCount the delegate store and request new layout by slotCount.

Cached items can be get with itemsFor.

getAllItems will call if necessary. If your item getter is not Future, do not override as async, because if you use unnecessary Future, layout changes not animated on slotCount changes.

onItemsAdded will call when DashboardItemController.add or addAll called. Function called with up-to-date layout data.

onItemsUpdated will call when item layout changes. Layout can be changed by user or initially re-mount operations. Function called with up-to-date layout data.

onItemsDeleted will call when item deleted by DashboardItemController.delete or deleteAll called.

Properties

cacheItems bool
If cacheItems the delegate store layouts from memory.
no setter
hashCode int
The hash code for this object.
no setterinherited
layoutsBySlotCount bool
If layoutsBySlotCount the delegate store and request new layout by slotCount.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAllItems(int slotCount) FutureOr<List<T>>
getAllItems will call if necessary. If your item getter is not Future, do not override as async, because if you use unnecessary Future, layout changes not animated on slotCount changes.
itemsFor(int slotCount) Map<String, T>?
Item list for given slotCount
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onItemsAdded(List<T> items, int slotCount) FutureOr<void>
onItemsAdded will call when DashboardItemController.add or addAll called. Function called with up-to-date layout data.
onItemsDeleted(List<T> items, int slotCount) FutureOr<void>
onItemsDeleted will call when item deleted by DashboardItemController.delete or deleteAll called.
onItemsUpdated(List<T> items, int slotCount) FutureOr<void>
onItemsUpdated will call when item layout changes. Layout can be changed by user or initially re-mount operations. Function called with up-to-date layout data.
toString() String
A string representation of this object.
inherited

Operators

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