Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encountered some issues #34

Open
noumi92 opened this issue Mar 19, 2022 · 1 comment
Open

Encountered some issues #34

noumi92 opened this issue Mar 19, 2022 · 1 comment

Comments

@noumi92
Copy link

noumi92 commented Mar 19, 2022

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;

@noumi92
Copy link
Author

noumi92 commented Mar 19, 2022

I am just a beginner. It is not to criticize rather to get help and learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant