material_design_icons_flutter icon indicating copy to clipboard operation
material_design_icons_flutter copied to clipboard

const Map/List of all IconData

Open jlnrrg opened this issue 4 years ago • 4 comments

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.

jlnrrg avatar Oct 15 '21 00:10 jlnrrg

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.

ItsJimi avatar Oct 15 '21 07:10 ItsJimi

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.

ziofat avatar Oct 19 '21 05:10 ziofat

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)

jlnrrg avatar Oct 19 '21 06:10 jlnrrg

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

bambinoua avatar Jun 09 '23 21:06 bambinoua