I have API and its return the name of fontAwsome icon like below
"value": 1,
"feature": {
"title": "WC"
"image": " fa-toilet",
"VIP": 6,
}
and I need to change image to Font Awesome Icons
I know one way that is we need create an map and define on that what icon belong to what string
like this
Map<String,IconData> icons = {
'fa-toilet': FontAwesomeIcons.toilet
};
but I need another way
HELP plz
2
Answers
I found something :D
if in API we have unicode of icons we can show its easily I think its best and easy way
with this function you can change unicode to icon ↓↓
./util/configurator.sh --dynamic
on terminalNotice that you have to add its style before the icon name (for example,
solid
).You may also need to build your app with the
--no-tree-shake-icons
flag.Reference: