I found an ugly bug in your example code: Adding and removing emojis with the build-in backspace button only works if the cursor is at the and if the input text. It is not possible to add an emoji between to words and also remove an emoji (or even normal characters) inside a text. While I updated the example it turns out to be quite complex with many edge cases. So I wonder why the library does not handle this complex stuff itself to make it very easy to use. That's what I done inside this PR: I added a paramater TextEditingController to the EmojiPicker where you can (optionally) pass some TextEditingController which is linked to some sort of TextField (I bet this is the use-case in 99 %). And then you are done! The EmojiPicker widget handles all the complex logic for you. Check out the example to get an idea how simple it now is.
And yes, it contains no breaking changes (even if it sounds like^^).
Hi there!
I found an ugly bug in your example code: Adding and removing emojis with the build-in backspace button only works if the cursor is at the and if the input text. It is not possible to add an emoji between to words and also remove an emoji (or even normal characters) inside a text. While I updated the example it turns out to be quite complex with many edge cases. So I wonder why the library does not handle this complex stuff itself to make it very easy to use. That's what I done inside this PR: I added a paramater
TextEditingController
to theEmojiPicker
where you can (optionally) pass someTextEditingController
which is linked to some sort ofTextField
(I bet this is the use-case in 99 %). And then you are done! TheEmojiPicker
widget handles all the complex logic for you. Check out the example to get an idea how simple it now is.And yes, it contains no breaking changes (even if it sounds like^^).
Hope you like it :)
And by the way I bumped the dependency constraints to Flutter 3 which fixes https://github.com/Fintasys/emoji_picker_flutter/issues/84.