ziofat / material_design_icons_flutter

The Material Design Icons (https://materialdesignicons.com/) Icon pack available as set of Flutter Icons.
MIT License
167 stars 32 forks source link

const Map/List of all IconData #39

Open jlnrrg opened 2 years ago

jlnrrg commented 2 years ago

As it looks to me the package is auto generated based on the MDI font. (Or that is how i've done it with the simple icons package)

Please consider adding a static list, where one can get all the icons at one. Example:

static const List<IconData> all = [
    MdiIcons.abTesting,
  ];

Every user of the library could implement this themself, but with so many icons this would take a lot of time. Under the premise that the mdi.dart is autogenerated, this might be just one line of code for you :pray: .

Example Use Case: There is the icon_picker which takes a Map<String, IconData> of icons. For performance improvements an already existing const List or Map of IconData might be beneficial.

ItsJimi commented 2 years ago

Hi @jlnrrg, you can get icons name using getIconsName() to create your picker (but maybe a real list is better for you). Let me know if you need an example.

ziofat commented 2 years ago

You can get icon list in https://github.com/ziofat/material_design_icons_flutter/blob/master/lib/icon_map.dart, though it is not satisfied to Map<String, IconData> but I believe it is really easy to transform.

jlnrrg commented 2 years ago

thanks for the advice. Of cause it is really easy to transform. I was speaking more from the performance sie of things (even though i have no measure how much the const would effect)

bambinoua commented 1 year ago

@ziofat, @jlnrrg I think this issue can be closed as iconMap is a const now.