Flutter shows me the following error message although I converted map into List
The argument type 'List<Set<Card>>' can't be assigned to the parameter type 'List<Widget>'.dartargument_type_not_assignable
May you please tell me what's wrong?
class MyHomePage extends StatelessWidget {
MyHomePage({Key? key, required String title}) : super(key: key);
final List<Transaction> transactions = [
Transaction(
id: 'sh1',
date: DateTime.now(),
title: 'School',
value: 1554.5
),
Transaction(
id: 'sc5',
date: DateTime.now(),
title: 'Sucar',
value: 16.5
),
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("title"),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Card(
color: Color.fromRGBO(200, 165, 245, 1.0),
child: Text('[CHART]'),
),
Column(
children:
/////// ERROR
transactions.map( (e) => { return Card(child: Text(e.title),); } ).toList(),
),
],
),
);
}
}