I have a List:
List<MenuItem> makanan = [
MenuItem(
gambarMenu: Image.asset('images/nasigoreng.jpeg'),
namaMenu: 'Nasi Goreng',
priceMenu: 'Rp. 15.000',
qty: 0,
note: 'Catatan',
),
MenuItem(
gambarMenu: Image.asset('images/mie goreng.jpeg'),
namaMenu: 'Mie Goreng',
priceMenu: 'Rp. 15.000',
qty: 0,
note: 'Catatan',
),
MenuItem(
gambarMenu: Image.asset('images/nasigoreng.jpeg'),
namaMenu: 'Mie Kuah',
priceMenu: 'Rp. 15.000',
qty: 0,
note: 'Catatan',
),
MenuItem(
gambarMenu: Image.asset('images/nasigoreng.jpeg'),
namaMenu: 'Nasi Campur',
priceMenu: 'Rp. 15.000',
qty: 0,
note: 'Catatan',
),
MenuItem(
gambarMenu: Image.asset('images/nasigoreng.jpeg'),
namaMenu: 'Bakso Komplit',
priceMenu: 'Rp. 15.000',
qty: 0,
note: 'Catatan',
),
];
also have Model that I want to make list from my previous list like this:
class TableOrder {
String namaMakanan;
int qtyMakanan;
String noteMakanan;
TableOrder({this.namaMakanan, this.qtyMakanan, this.noteMakanan});
}
How can I get data from previous list into new list based on their qty value, if the qty is more than 0 that data will be added into new list.