How can I convert a List<String>
to List<IconData>
? I have the following ['Icons.check', 'Icons.cancel']
which I get back from the database, and I need to convert it to List<IconData>
.
I have tried the following:
final icons = List<String>.from(widget.values[0]['icons'] as List<IconData>
3
Answers
Try saving the icon’s codePoint property to the database.
Use it
Try the following code:
1. Statically
2. Dynamically
Example:
Then you can get your
IconData
as: