Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const Map/List of all IconData #39

Open
jlnrrg opened this issue Oct 15, 2021 · 4 comments
Open

const Map/List of all IconData #39

jlnrrg opened this issue Oct 15, 2021 · 4 comments

Comments

@jlnrrg
Copy link

jlnrrg commented Oct 15, 2021

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 🙏 .

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
Copy link
Contributor

ItsJimi commented Oct 15, 2021

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
Copy link
Owner

ziofat commented Oct 19, 2021

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
Copy link
Author

jlnrrg commented Oct 19, 2021

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
Copy link
Contributor

bambinoua commented Jun 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants