This repository was archived by the owner on Feb 22, 2023. It is now read-only.
[cloud_firestore] Add metadata to QuerySnapshot#1915
Merged
kroikie merged 10 commits intoflutter:masterfrom Jul 28, 2019
Merged
[cloud_firestore] Add metadata to QuerySnapshot#1915kroikie merged 10 commits intoflutter:masterfrom
kroikie merged 10 commits intoflutter:masterfrom
Conversation
Contributor
collinjackson
left a comment
There was a problem hiding this comment.
Reminder to update CHANGELOG and pubspec before merging.
| stream: firestore.collection('messages').snapshots(), | ||
| builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) { | ||
| if (!snapshot.hasData) return const Text('Loading...'); | ||
| print(snapshot.data.metadata.isFromCache); |
Contributor
There was a problem hiding this comment.
I would suggest removing these.
Contributor
Author
There was a problem hiding this comment.
Oops that was not supposed to make it into the PR, thanks!
| /// is the first snapshot, all documents will be in the list as Added changes. | ||
| final List<DocumentChange> documentChanges; | ||
|
|
||
| final SnapshotMetadata metadata; |
Contributor
There was a problem hiding this comment.
We should be able to add unit testing and a basic integration test for this, right? Even just asserting that hasPendingWrites and isFromCache aren't null would be better than nothing.
Contributor
Author
There was a problem hiding this comment.
Done, I checked that the metadata property of the QuerySnapshot was not null.
66deb36 to
8748653
Compare
collinjackson
approved these changes
Jul 26, 2019
| @@ -1,3 +1,7 @@ | |||
| ## 0.12.8+1 | |||
|
|
|||
| * Add metatdata to QuerySnapshot. | |||
Contributor
There was a problem hiding this comment.
Suggested change
| * Add metatdata to QuerySnapshot. | |
| * Add `metadata` to `QuerySnapshot`. |
Contributor
Author
|
Once tests pass I'll merge and publish. |
c9c8d61 to
99d6275
Compare
Contributor
|
This looks ready to merge, thanks! |
mithun-mondal
pushed a commit
to bKash-developer/archived_plugins
that referenced
this pull request
Aug 6, 2019
* Add metadata to QuerySnapshot
julianscheel
pushed a commit
to jusst-engineering/plugins
that referenced
this pull request
Mar 11, 2020
* Add metadata to QuerySnapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bring
cloud_firestoreplugin in line with native SDKs by exposing the metadata of QuerySnapshot.Related Issues
Fixes: flutter/flutter#35550