Skip to content

2.0 Migration Problem.. #6043

Answered by stargazing-dino
Patrick386 asked this question in Q&A
Discussion options

You must be logged in to vote

When writing code snippets, make sure they're legible for others to better help you.

Please use highlighting and proper formatting. Darts language code is dart.

As for a way you can create a stream of product docs (if this is what you want) you can creating a stream of the snapshots and then consume that stream in another provider that exposes just the docs (This helps you separate concerns, the mapping of docs from the source stream).

final serviceProductSnapshotsProvider =
    StreamProvider.autoDispose<QuerySnapshot<ServiceProduct>>(
  (ref) => serviceProductCollectionRef.snapshots(),
);

final serviceProductDocsProvider =
    Provider.autoDispose<AsyncValue<List<DocumentSnapshot<Servi…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Patrick386
Comment options

@stargazing-dino
Comment options

@Patrick386
Comment options

@Patrick386
Comment options

Answer selected by Patrick386
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants