cloud_firestore_hooks library

Classes

AsyncSnapshotWithProgress<T, ProgressType extends Object>
A custom implementation of AsyncSnapshot that also contains the progress of the async operation. This is useful for showing a loading indicator with exact progress information.

Functions

useCollection<T>({required CollectionReference<T> collection, bool listen = false, GetOptions? getOptions, bool includeMetadataChanges = false, bool preserveState = true}) AsyncSnapshot<QuerySnapshot<T>>
useDocument<T>({required DocumentReference<T> ref, bool listen = false, bool preserveState = true}) AsyncSnapshot<DocumentSnapshot<T>>
usePaginatedQuery<T>({required Query<T> query, required Object orderBy, bool descending = false, int pageLimit = 10, int limit = 10, bool listen = false, GetOptions? getOptions, bool includeMetadataChanges = false, bool preserveState = true}) → PaginatedValue<QuerySnapshot<T>>
A paginated hook that will return a PaginatedValue with the data from the Firestore query. The Firestore query will be executed when the hook is called. Providing a limit will limit the number of documents returned. Passing a listen of true will cause the PaginatedValue to listen to the Firestore query via snapshots.
useQuery<T>({required Query<T> query, bool listen = false, GetOptions? getOptions, bool includeMetadataChanges = false, bool preserveState = true}) AsyncSnapshot<QuerySnapshot<T>>