EndlessFirestoreStreamListView<T> class

An infinite loading list view that displays documents loaded from the specified Query into a scrollable list. Subscribes to the documents returned from the query with the Query.snapshots API using the Query.limit approach described here. Note that this incurs a re-read of *all current documents when loading successive batches so be aware of the read pricing concerns there.

If live data updates are not required, consider using EndlessPaginationListView instead by executing your query in the EndlessPaginationListView.loadMore API.

Inheritance

Constructors

EndlessFirestoreStreamListView({required Widget itemBuilder(BuildContext context, {required int index, required QueryDocumentSnapshot<T> item, required int totalItems}), required Query<T> query, required EndlessFirestoreStreamBatchDelegate batchDelegate, double? extentAfterFactor, SliverPersistentHeader headerBuilder(BuildContext context)?, EndlessStateProperty? headerBuilderState, Widget emptyBuilder(BuildContext context)?, EndlessStateProperty? emptyBuilderState, Widget loadingBuilder(BuildContext context)?, EndlessStateProperty? loadingBuilderState, Widget loadMoreBuilder(BuildContext context)?, EndlessStateProperty? loadMoreBuilderState, Widget footerBuilder(BuildContext context)?, EndlessStateProperty? footerBuilderState, EndlessFirestoreStreamController? controller, ScrollController? scrollController, EdgeInsets? padding, double? itemPadding, Future<void> onLoad(List<QueryDocumentSnapshot<T>> items)?, void onStateChange(Set<EndlessState> states)?, dynamic key})
const

Properties

batchDelegate EndlessFirestoreStreamBatchDelegate
The delegate that specifies the Firestore stream requirements for the list view such as the maximum number of batches to load and the batch size.
final
controller EndlessFirestoreStreamController?
The stream controller used to perform actions on the list view such as loading more data or clearing the list.
final
emptyBuilder → (Widget Function(BuildContext context)?)
The builder function for the list view empty state.
final
emptyBuilderState EndlessStateProperty?
The state property for the list view empty state.
final
extentAfterFactor double?
The fraction of the remaining quantity of content conceptually "below" the viewport in the scrollable relative to the maximum height of the scrollable region at which point loadMore should be called to load more data.
final
footerBuilder → (Widget Function(BuildContext context)?)
The builder function for the list view footer.
final
footerBuilderState EndlessStateProperty?
The state property for the list view footer.
final
hashCode int
The hash code for this object.
no setterinherited
headerBuilder → (SliverPersistentHeader Function(BuildContext context)?)
The builder function for the list view header.
final
headerBuilderState EndlessStateProperty?
The state property for the list view header.
final
itemBuilder Widget Function(BuildContext context, {required int index, required QueryDocumentSnapshot<T> item, required int totalItems})
The builder function for the list view items.
final
itemPadding double?
The padding value in between each item in the list view.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingBuilder → (Widget Function(BuildContext context)?)
The builder function for the list view loading state.
final
loadingBuilderState EndlessStateProperty?
The state property for the list view loading state.
final
loadMoreBuilder → (Widget Function(BuildContext context)?)
The builder function for the list view load more action widget.
final
loadMoreBuilderState EndlessStateProperty?
The state property for the list view load more action widget.
final
onLoad → (Future<void> Function(List<QueryDocumentSnapshot<T>> items)?)
A function called after loading more data from Firestore. This function must finish before any new items are added to the list, allowing for any other data dependencies to be fetched before calling itemBuilder.
final
onStateChange → (void Function(Set<EndlessState> states)?)
A callback function that provides the current states of the endless scroll view whenever they change.
final
padding EdgeInsets?
The padding around the scroll view.
final
query → Query<T>
The Firestore query to execute to populate the items in the scroll view. A Query.limit is applied to the query for each load based on the specified EndlessFirestoreStreamBatchDelegate.batchSize.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
The scroll controller for the list view.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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