You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Encountered following bugs and applied undermentioned fixes
items were not initialized -> initialized as empty list static List<Item> items = List.empty(); required field missing in Item() constructor -> added required keyword Item({required this.id, ....}); Null safety found missing in copyWith() Item copyWith({ String? id ... In factory fromMap() the line which checks map nullability throwing error -> commented //if (map == null) return null; In home.dart list was not mapping to model -> distributed into two assignments List<Item> list = List.from(productsData) .map<Item>((item) => Item.fromMap(item)) .toList(); CatalogModel.items = list;
The text was updated successfully, but these errors were encountered:
Encountered following bugs and applied undermentioned fixes
items were not initialized -> initialized as empty list
static List<Item> items = List.empty();
required field missing in Item() constructor -> added required keyword
Item({required this.id, ....});
Null safety found missing in copyWith()
Item copyWith({ String? id ...
In factory fromMap() the line which checks map nullability throwing error -> commented
//if (map == null) return null;
In home.dart list was not mapping to model -> distributed into two assignments
List<Item> list = List.from(productsData)
.map<Item>((item) => Item.fromMap(item))
.toList();
CatalogModel.items = list;
The text was updated successfully, but these errors were encountered: