Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

Single document from firestore to a dart object

Stream<List<VehicleCommentSessionModel>> getSomeoneCommentsList(
   {@required String sellerId}) {
  return _fbd
     .collection('comments')
    .where('sellerId', isEqualTo: sellerId)
    .snapshots()
    .map((qSnap) => qSnap.docs
        .map((doc) => VehicleCommentSessionModel.fromJson(doc.data()))
        .toList());
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Single #document #firestore #dart #object
ADD COMMENT
Topic
Name
1+5 =