我有包含产品列表的类别列表.
现在我想展示所有类别的所有产品
我怎样才能像在Firebase中那样合并..我们有收集组的选项...
以下是我的代码
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),
]),
];