List<PopularBookModel> populars = popularBookData
.map((item) => PopularBookModel(item['title'], item['author'],
item['price'], item['image'], item['color'], item['description']))
.toList();
Result:
The argument type 'Object?' can't be assigned to the parameter type.
What should I do?
2
Answers
It look like
item
is of typeMap<String, Object>
, but the constructor ofPopularBookModel
takes specific types, most likelyString
. Try and see if this works:Or whatever type you expect to be there.
Please try the below code
After creating model, Now create a variable to use