Encountered following bugs and applied undermentioned fixes
items were not initialized -> initialized as empty liststatic List<Item> items = List.empty();required field missing in Item() constructor -> added required keywordItem({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 assignmentsList<Item> list = List.from(productsData).map<Item>((item) => Item.fromMap(item)).toList();CatalogModel.items = list;
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 keywordItem({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 assignmentsList<Item> list = List.from(productsData)
.map<Item>((item) => Item.fromMap(item))
.toList();
CatalogModel.items = list;