我试图用 Category 创建一个 Listview,但找不到任何解决方案。我需要一些帮助。
List<Product> products = [
{
"ProductID":"1234",
"ProductName":"Milk",
"ProductCategory":"Dairy",
},
{
"ProductID":"12345",
"ProductName":"Apple",
"ProductCategory":"Fruits",
},{
"ProductID":"12342",
"ProductName":"Chicken",
"ProductCategory":"Meat",
},{
"ProductID":"123422",
"ProductName":"Eggs",
"ProductCategory":"Dairy",
},
{
"ProductID":"1234222",
"ProductName":"Bread",
"ProductCategory":"Dairy",
}
];
如何ListView
按类别区分?