CollectionController<T, K, F> class final

Compatibility facade over Carpenter's canonical collection lifecycle.

Historically this controller implemented its own generation-based stale response protection. That duplicated CollectionLifecycleController and made the two collection APIs subtly diverge. Existing adapter-based callers may keep using this facade while all loading, failure, refresh, cancellation, and event semantics are owned by one lifecycle implementation underneath.

Inheritance
Annotations
  • @Deprecated('Use CollectionLifecycleController for new collection data flows.')

Constructors

CollectionController({required CollectionAdapter<T, F> adapter, required CollectionQuery<F> query, required CollectionSnapshot<T> snapshot, required K keyOf(T item)})
Creates the compatibility facade and its owned lifecycle controller. No request starts until load or refresh is invoked.

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
query CollectionQuery<F>
Current query of the underlying lifecycle owner.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshot CollectionSnapshot<T>
Current immutable snapshot of the underlying lifecycle owner.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
apply(CollectionEvent<T, K> event) → void
Applies a presentation event and forwards the underlying lifecycle notification.
dispose() → void
Detaches forwarding and disposes the owned lifecycle controller, cancelling its pending work.
override
load(CollectionQuery<F> query) Future<void>
Replaces the query and awaits the canonical lifecycle loader. Prefer CollectionLifecycleController.updateQuery in new integrations.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
refresh() Future<void>
Refreshes the current query through the canonical lifecycle, retaining usable data.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
inherited

Operators

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