Closed xanf-code closed 3 years ago
@xanf-code what is the error ? if you are talking about FirestoreCollection initialisation correct I think @furkansarihan forget to add collection field, you can configure like this
FirestoreCollection fireCollection = FirestoreCollection(
collection: FirebaseFirestore.instance
.collection('posts')
.doc('post_id')
.collection("comments"),
initializeOnStart: true,
// first page will fetched immediately
offset: 15,
// page size
serverOnly: false,
// cache first
live: true,
// notifies to newest comments
query: FirebaseFirestore.instance
.collection('posts')
.doc('post_id')
.collection("comments"),
orderField: 'timestamp',
);
@furkansarihan please update doc
@xanf-code This package designed for sequential data, for example messages.
If firestore_collection
is ordered by timestamp
filed of a message document;
New inserted documents can be listenable. (The documents has bigger timestamp value than, current bigger in firestore_collection
)
changed_at
&changed_at
field used for order field in firestore_collection
&changed_at
field also got an update with newest timestamp value (server timestamp)With all conditions above, document changes can be listenable.
Note: This approach could has some bugs caused missing documents on lazy-load.
I am currently investigating this approach and planning to make it stable.
This helped, thank you.
The document changes are not being reflected in real time, or am i missing something?