Want to call Icons.album with the string "album" like Icons["album"] but it's not work's. do I need to do enum for each icon or it was a other way ?
List tasks = [{
"title": "task 1",
"description": "description 1",
"icon": "ring_volume",
},{
"title": "task 2",
"description": "description 2",
"icon": "flag",
},{
"title": "task 3",
"description": "description 3",
"icon": "album",
},
];
[...]
Widget taskCard(Map task) {
Text title = Text(task['title']);
return Center(
child: Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: Icons(Icons.album), // HERE
title: new Text(task['title']),
subtitle: new Text(task['description']),
),
],
),
),
);
}