Fintasys / emoji_picker_flutter

A Flutter package that provides an Emoji picker widget with 1500+ emojis in 8 categories.
MIT License
170 stars 127 forks source link

adds filterUnsupported method to EmojiPickerUtils #221

Open maeddin opened 3 weeks ago

maeddin commented 3 weeks ago

closes #220

Fintasys commented 2 weeks ago

Can you provide more contex to this? In what situation this would be useful for the users?

maeddin commented 2 weeks ago

@Fintasys

Can you provide more contex to this? In what situation this would be useful for the users?

I need this method, for example, to be able to display the emojis of the corresponding platform myself, as I would like to preload them. Otherwise there is always a short loading time when opening the EmojiPicker, as this method is called every time it is opened.

I haven't found a good way to integrate preloading directly into the package, so I would like to make this method publicly available.

Fintasys commented 2 weeks ago

@maeddin I see, but calling filterUnsupported wouldn't do any preloading. It would just filter emoji based on platform and return the list to you. When the EmojiPicker is used it would load all emoji again. In general the waiting time to load should be milliseconds, so I wonder why you seeing loading indicator. Which platform are you referring to? Nevertheless, I understand the issue with the preloading that eventually some people face. I would rather suggest to cache the emojiList in the Utils and add an manual initialization method. I might find time trying to come up with a PR in the next days, if you can wait.

maeddin commented 2 weeks ago

@Fintasys I preload the emojis I need once when the app is started so that they are already loaded when my EmojiPicker opens for the first time. It only takes milliseconds to load, but the emojis still appear after the first frame, which is why I have implemented preloading for myself. Since I have also implemented the entire EmojiPicker myself due to design specifications, it is easier for me to call filterUnsupported directly. This way I can handle the caching myself and also determine when the preloading takes place.