I have list of category that contains list of products..
Now i want to show all products from this all categories
How can i merge like in firebase ..we have option for collectionGroup…
here is my code
List<CategoryModel> categories = [
CategoryModel(id: '1', title: 'Shoes', products: [
Product(id: '1', name: 'Puma', price: 2304.0),
]),
CategoryModel(id: '2', title: 'Shirts', products: [
Product(id: '1', name: 'Spykar', price: 2344.0),
]),
CategoryModel(id: '3', title: 'Jeans', products: [
Product(id: '1', name: 'Killer', price: 7838.0),
Product(id: '2', name: 'Wrangler', price: 12000.0),
]),
];
3
Answers
I had applied following it works but not looking good code..Your code is good way of coding..
i think i understand your problem and i have your problem solution may be this gonna workout in your scenario try to follow these steps:
here i am adding my code snippet which may help you out in your query
i modified it according to your list