null safety
This commit is contained in:
@@ -35,7 +35,7 @@ class _MarketEditorState extends State<MarketEditor> {
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Text(
|
||||
p.name,
|
||||
p.name ?? "",
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
),
|
||||
@@ -117,7 +117,7 @@ class _MarketEditorState extends State<MarketEditor> {
|
||||
});
|
||||
MarketModel marketModel = Provider.of<MarketModel>(context, listen: false);
|
||||
try {
|
||||
await marketModel.deleteMarket(market.id);
|
||||
await marketModel.deleteMarket(market.id!);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user