I'm creating a datawidget
to display some data in table, The data content is in a list, I tried mapping it to rows of datawidget
but I get this error when I try amountpaid.map
The argument type 'Iterable' can't be assigned to the parameter type 'List'
I don't understand the error, what does that mean and how do I solve it.
amountpaidclass
class amountPaidClass {
int amount;
amountPaidClass({required this.amount});
}
var amountpaid = <amountPaidClass>[
amountPaidClass(amount: 1000),
amountPaidClass(amount: 5000),
amountPaidClass(amount: 7000)
];
Displaying data
body: Center(
child: Container(
child: DataTable(
columns: const [DataColumn(label: Text('Amount'))],
rows: amountpaid.map((amountPaidClass) => null)
),
),
)