Ahmadre / FlutterIconPicker

An adaptive comprehensive IconPicker for Flutter
MIT License
112 stars 76 forks source link

FlutterIconPicker not updating to current params #38

Closed veloso14 closed 2 years ago

veloso14 commented 2 years ago

Hello,

I am facing an issue where on one screen I pass my own customIconPack and after pushing a new screen with iconPackModes: [IconPack.fontAwesomeIcons] and going back to the previous I get shown all the icons and not just my custom one. I believe this is due to the fact that the showIconPicker is static.

Congrats on the lib btw.

veloso14 commented 2 years ago

I did manage to find a fix, on the build doing this....

image

veloso14 commented 2 years ago

My thoughts are since this is static if I change from a custom icon pack to an IconPack like font awesome and back again the initState() won't be called. Which will lead to this behavior.

Ahmadre commented 2 years ago

My thoughts are since this is static if I change from a custom icon pack to an IconPack like font awesome and back again the initState() won't be called. Which will lead to this behavior.

Thanks for your issue.

Actually it's very old the static stuff.

You can open a merge request by using provider and ChangeNotifier for this to solve, or you can wait until I've implemented it :)

But very good finding 🤝

veloso14 commented 2 years ago

@Ahmadre ok I will try to open a PR during this week

Ahmadre commented 2 years ago

@veloso14 Thank you for your work on the PR. I refactored a lot and put the Provider at the right place to be only initialized once.

Please check the newest changes in master branch here with:

dependecies:
  flutter_iconpicker:
    git: git://github.com/Ahmadre/FlutterIconPicker.git

After you approved it, I will release a new version 👍🏼

Ahmadre commented 2 years ago

As this was merged and works I will close this issue.

If you have any questions or concerns, please reopen this :) thx