CollectionMutationState<K> class final

Immutable item-level mutation status keyed independently of the current loaded rows.

It describes progress and reconciliation only; it neither performs persistence nor rolls back data. Use separate instances for independently running operations.

Annotations

Constructors

CollectionMutationState({CollectionMutationPhase phase = CollectionMutationPhase.idle, Iterable<K> affectedKeys = const [], bool optimistic = false, CollectionReconciliation reconciliation = CollectionReconciliation.none, CollectionFailure? failure})
Creates mutation status and defensively copies affectedKeys into an unmodifiable set.

Properties

affectedKeys Set<K>
Stable keys affected by this operation, including keys outside the loaded page.
final
failure CollectionFailure?
Optional error information when the operation failed.
final
hashCode int
The hash code for this object.
no setterinherited
optimistic bool
Whether the caller presented the change before authoritative confirmation.
final
phase CollectionMutationPhase
Current operation execution phase.
final
reconciliation CollectionReconciliation
Confirmation or rollback status of an optimistic change.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

failed(CollectionFailure failure, {bool rolledBack = false}) CollectionMutationState<K>
Records failure for the same keys and preserves optimistic status. Setting rolledBack marks reconciliation as rolled back; it does not undo application data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
running(Iterable<K> keys, {bool optimistic = false}) CollectionMutationState<K>
Starts a new status for keys, clearing any previous failure. Optimistic operations begin pending reconciliation; others require no reconciliation.
succeeded() CollectionMutationState<K>
Returns successful status for the same keys. Optimistic changes become confirmed and failure information is cleared.
toString() String
A string representation of this object.
inherited

Operators

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