Closed timmaffett closed 1 year ago
@timmaffett Thanks for your improvements to the example ! Code-wise it looks good to me, but I would like to avoid too much complexity in the basic example. I would prefer to create an extra example e.g. main-dynamic-columns.dart
in the example folder. What do you think ?
@Fintasys I have moved the dynamic column sizing to it's own file.
I was just trying to illustrate it was a 9 pixel margin on both sides of the emoji. The compiler does the math so it is identical to writing 18. Maybe I need to explain that in a comment or just put 18.. 😜
On Sun, Jun 4, 2023, 6:01 AM Stefan Humm @.***> wrote:
@.**** commented on this pull request.
In example/lib/main-dynamic-columns.dart https://github.com/Fintasys/emoji_picker_flutter/pull/134#discussion_r1216676697 :
+} + +class _MyAppState extends State
{
- final TextEditingController _controller = TextEditingController();
- bool emojiShowing = false;
- @override
- void dispose() {
- _controller.dispose();
- super.dispose();
- }
- @override
- Widget build(BuildContext context) {
- final screenSize = MediaQuery.of(context).size;
- final emojiPadding = 9*2;
Any reason for not just writing 18 ? 🤔
— Reply to this email directly, view it on GitHub https://github.com/Fintasys/emoji_picker_flutter/pull/134#pullrequestreview-1461176044, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3YUSLVVKELO4DUVP6HDPLXJSBLBANCNFSM6AAAAAAXRD4OFA . You are receiving this because you were mentioned.Message ID: @.***>
Comment makes more sense. After that I gonna merge, thanks for the work!
Seems also Github actions are failing. Please run flutter format lib test example
before pushing
done and I ran dart format
as well.
This change makes the number of columns for the emoji picker dynamic based on screen width. When running the example on windows I was surpised to see this ridiculous result:
Here instead is a more expected behavior for an emoji picker (this is the example with this PR added):
For clarity I split out all of the emoji size related calculations to the top of the build method to better illustrate to the users what is going on.
For mobile versions the number of columns remains a reasonable number (for Pixel3 emulator it remains 7 as it was hard coded, for more modern phones the number of emoji columns increases as one would expect).
Thanks for the nice package!