FirebaseDatabaseListView class

A ListView.builder that obtains its items from a Firestore query.

As an example, consider the following collection:

final moviesCollection = FirebaseDatabase.instance.ref('movies');

Using FirebaseDatabaseListView, we can now show the list of movies by writing:

FirebaseDatabaseListView(
  query: moviesCollection,
  itemBuilder: (context, snapshot) {
    var movie = snapshot.value as Map;
    return Text(movie['title']);
  },
)

For advanced UI use-cases, consider switching to FirebaseDatabaseQueryBuilder.

Inheritance

Constructors

FirebaseDatabaseListView({Key? key, required Query query, required FirebaseItemBuilder itemBuilder, int pageSize = 10, FirebaseLoadingBuilder? loadingBuilder, FirebaseErrorBuilder? errorBuilder, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool shrinkWrap = false, EdgeInsetsGeometry? padding, double? itemExtent, Widget? prototypeItem, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, int? semanticChildCount, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, String? restorationId, Clip clipBehavior = Clip.hardEdge})
A ListView.builder that obtains its items from a Firestore query.

Properties

builder → FirebaseQueryBuilderSnapshotBuilder
finalinherited
child Widget?
A widget that will be passed to builder for optimizations purpose.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
pageSize int
The number of items that will be fetched at a time.
finalinherited
query → Query
The query that will be paginated.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _FirestoreQueryBuilderState
Creates the mutable state for this widget at a given 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