Conversation
Codecov Report
@@ Coverage Diff @@
## main #99 +/- ##
============================================
- Coverage 100.00% 86.84% -13.16%
============================================
Files 1 1
Lines 31 38 +7
============================================
+ Hits 31 33 +2
- Misses 0 5 +5
Continue to review full report at Codecov.
|
| /// pass toFirestore method to converter | ||
| static Future<QuerySnapshot<T>> getDocuments<T>({ | ||
| required Query<T> query, | ||
| required DocumentReference<T> cacheDocRef, |
There was a problem hiding this comment.
I can understand the use case for Query<T> then returning QuerySnapshot<T>. But can people simply pass in the default Map<String, dynamic> for cacheDocRef? For the example code you shared, can you pass in FirebaseFirestore.instance.doc('col/doc') instead? This document is simply used for fetching the cache date info, so I would imagine there's no need to use the parameter with the converters.
Also, I don't think it can use the same type T which is used for Query and the returned QuerySnapshot>, as it probably has a different type.
now support firestore documents with custom converter
before documents initiated with withConverter collection couldn't be passed into function because
function takes DocumentReference<Map<String,dynamic>> type but our doc is DocumentReference type
error befor---
`
final doc=i.collection("col").withConverter(fromFirestore: fromFirestore, toFirestore: toFirestore).doc("doc");
`