null safety

This commit is contained in:
phyothandar
2021-09-10 15:22:11 +06:30
parent 51a5fe0740
commit c90661b262
24 changed files with 194 additions and 193 deletions

View File

@@ -20,14 +20,14 @@ class MarketModel extends BaseModel {
try {
if (listener != null) listener.cancel();
listener = Firestore.instance
listener = FirebaseFirestore.instance
.collection("/$config_collection/$setting_doc_id/$markets_collection")
.snapshots()
.listen((QuerySnapshot snapshot) {
markets.clear();
markets = snapshot.documents.map((documentSnapshot) {
markets = snapshot.docs.map((documentSnapshot) {
var user = Market.fromMap(
documentSnapshot.data, documentSnapshot.documentID);
documentSnapshot.data as Map<String, dynamic>, documentSnapshot.id);
return user;
}).toList();
notifyListeners();