skip to Main Content

Flutter – How to convert a String from Firestore to a Enum?

I get a snapshot from Firestore like this: return userCollection .doc(uid) .collection('values') .where( "created", isGreaterThanOrEqualTo: fromDate, isLessThan: toDate, ) .orderBy('created', descending: true) .snapshots() .map((list) => list.docs.map((doc) => Values.fromSnapshot(doc)).toList()); then I convert it to a Values Model: Values.fromSnapshot(DocumentSnapshot<Map<String, dynamic>> snapshot) :…

VIEW QUESTION
Back To Top
Search