Skip to content

Encountered some issues #34

Description

@noumi92

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions