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),
]),
];
categories.expand((element) => element.products)