vendredi 23 juillet 2021

Use reflection to loop over all available Icons

Flutter provides an Icons class which defines a long series of available icons:

https://api.flutter.dev/flutter/material/Icons-class.html#constants

I need the user to be able to set the icons for certain icon buttons, and I want to offer them a list of possibilities to chose from. Is it possible to generate such a list of IconData by somehow iterating over the static constants of the Icons class?





Aucun commentaire:

Enregistrer un commentaire