Chunk<T, CursorType> class

A subset of data retrieved from a data source.

A Chunk is used to store what the last "chunk" of retrieved data was.

Constructors have been created to facilitate proper state creation. The default constructor should be used initially, then Chunk.next should be used when more data is available in the data source, and Chunk.last when no more data is available.

See Chunker for a usable implementation using the Chunks.

Constructors

Chunk({int limit = defaultLimit})
Used to initiate data retrieval.
const
Chunk.last({required List<T> data, required CursorType? cursor, int limit = defaultLimit})
Used to signal no more data is available from the data source.
const
Chunk.next({required List<T> data, required CursorType? cursor, int limit = defaultLimit})
Used to signal more data is available from the data source.
const

Properties

cursor → CursorType?
An identifier use to find the last value retrieved from the data source.
final
data List<T>
The items retrieved from the data source.
final
hashCode int
The hash code for this object.
no setterinherited
limit int
The maximum amount of items to retrieve with each Chunk
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status ChunkStatus
Whether or not more chunks are able to be retrieved from the data source.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.

Operators

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

Constants

defaultLimit → const int