InterleavedSourceState<Item> class
final
An immutable snapshot of a single data source's state within an InterleavablePageableController.
This class is used by InterleaveStrategy implementations to make decisions about:
- Item ordering — how to merge items from multiple sources into one list (via items and priority).
- Fetch routing — which sources to fetch from next (via canLoadMore, isFetching, and status).
Instances are created by the controller's internal _buildSourceStates
method and are immutable — the items list is wrapped in
List.unmodifiable to prevent accidental mutation by strategies.
This class mixes in EqualsAndHashCode for value-based equality, enabling efficient change detection in widgets.
- Mixed-in types
Constructors
-
InterleavedSourceState({required String id, required int priority, required List<
Item> items, required bool canLoadMore, required bool isFetching, required PageableStatus status, dynamic error}) -
Creates an immutable snapshot of a source's state.
const
Properties
- canLoadMore → bool
-
Whether this source can load more data.
final
- error → dynamic
-
The most recent error thrown by this source's fetch callback, or
nullif the last fetch succeeded.final - hasError → bool
-
Whether this source encountered an error.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasItems → bool
-
Whether this source has fetched any items.
no setter
- id → String
-
The unique identifier of the source this state represents.
final
- isFetching → bool
-
Whether this source is currently executing a fetch operation.
final
- itemCount → int
-
The number of items fetched from this source.
no setter
-
items
→ List<
Item> -
The cumulative list of items fetched from this source across all pages.
final
- priority → int
-
The priority of the source, where lower numbers indicate higher priority.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → PageableStatus
-
The computed PageableStatus of this source, derived from its internal
state.
final
Methods
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode, andtoString.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited