A Flutter package that provides an Emoji picker widget with 1500+ emojis in 8 categories.

Overview

platform flutter build Star on Github License: BSD-2-Clause

emoji_picker_flutter

Yet another Emoji Picker for Flutter 🤩

Note: This package is based on emoji_picker which has been deprecated and not maintained anymore. Therefore I decided to create a modernized version of it and fixing existing issues.

Key features

  • Lightweight Package
  • Faster Loading
  • Null-safety
  • Completely customizable
  • Material Design and Cupertino mode
  • Emojis that cannot be displayed are filtered out (Android Only)
  • Optional recently used emoji tab

Getting Started

EmojiPicker(
    onEmojiSelected: (category, emoji) {
        // Do something when emoji is tapped
    },
    onBackspacePressed: () {
        // Backspace-Button tapped logic
        // Remove this line to also remove the button in the UI
    },
    config: Config(
        columns: 7,
        emojiSizeMax: 32.0,
        verticalSpacing: 0,
        horizontalSpacing: 0,
        initCategory: Category.RECENT,
        bgColor: Color(0xFFF2F2F2),
        indicatorColor: Colors.blue,
        iconColor: Colors.grey,
        iconColorSelected: Colors.blue,
        progressIndicatorColor: Colors.blue,
        showRecentsTab: true,
        recentsLimit: 28,
        noRecentsText: "No Recents",
        noRecentsStyle:
            const TextStyle(fontSize: 20, color: Colors.black26),
        categoryIcons: const CategoryIcons(),
        buttonMode: ButtonMode.MATERIAL
    ),
)

See the demo for more detailed sample project.

Config

property description default
columns Number of emojis per row 7
emojiSizeMax Width and height the emoji will be maximal displayed 32.0
verticalSpacing Verical spacing between emojis ToastGravity.BOTTOM
horizontalSpacing Horizontal spacing between emojis 0
initCategory The initial Category that will be selected Category.RECENT
bgColor The background color of the Widget Color(0xFFF2F2F2)
indicatorColor The color of the category indicator Colors.blue
iconColor The color of the category icons Colors.grey
iconColorSelected The color of the category icon when selected Colors.blue
progressIndicatorColor The color of the loading indicator during initalization Colors.blue
backspaceColor The color of the backspace icon button Colors.blue
showRecentsTab Show extra tab with recently used emoji true
recentsLimit Limit of recently used emoji that will be saved 28
noRecentsText The text to be displayed if no recent emojis to display "No Recents"
noRecentsStyle The text style for [noRecentsText] TextStyle(fontSize: 20, color: Colors.black26)
categoryIcons Determines the icon to display for each Category. You can change icons by setting them in the constructor. CategoryIcons()
buttonMode Choose between Material and Cupertino button style ButtonMode.MATERIAL

Backspace-Button

You can add an Backspace-Button to the end category list by adding the callback method onBackspacePressed: () { } to the EmojiPicker-Widget. This will make it easier for your user to remove an added Emoji without showing the keyboard. Check out the example for more details about usage.

Custom view

The appearance is completely customizable by setting customWidget property. If properties in Config are not enough you can inherit from EmojiPickerBuilder (recommended but not necessary) to make further adjustments.

class CustomView extends EmojiPickerBuilder {
    CustomView(Config config, EmojiViewState state) : super(config, state);

    @override
    _CustomViewState createState() => _CustomViewState();
}

class _CustomViewState extends State {
    @override
    Widget build(BuildContext context) {
        // TODO: implement build
        // Access widget.config and widget.state
        return Container();
    }
}

EmojiPicker(
    onEmojiSelected: (category, emoji) { /* ...*/ },
    config: Config( /* ...*/ ),
    customWidget: (config, state) => CustomView(config, state),
)

Feel free to contribute to this package!! 🙇‍♂️

Always happy if anyone wants to help to improve this package !

If you need any features

Please open an issue so that we can discuss your feature request 🙏


Made with 💙 in Tokyo
Comments
  • Support Web platform

    Support Web platform

    Every platform seems not support all of the emoji and it's difficult to filter them. I'm looking for ideas for filtering methods beside doing it manually.

    help wanted 
    opened by Fintasys 14
  • [Feature] Add EmojiPickerUtils for advanced usage

    [Feature] Add EmojiPickerUtils for advanced usage

    close: #37

    I encountered a need to search for emojis feature, but I can’t get all emojis, so I think a public method class should be implement for the convenience of expansion.

    I think this change should be very useful, for example:

    1. when our package adds a category, we don’t need to modify it in multiple places
    2. want to expand the function of searching emoticons, at this time, we need to get all the expressions, this method does not require the user to reassemble all the expression data.
    opened by zhourengui 8
  • Controller's length property (9) does not match the number of I/flutter (31446): tabs (17) present in TabBar's tabs property.

    Controller's length property (9) does not match the number of I/flutter (31446): tabs (17) present in TabBar's tabs property.

    Context:

    • emoji_picker_flutter 1.4.0
    • Flutter 3.3.3
    • Android 10 device (no AVD)

    WhatsApp Image 2022-09-29 at 16 49 25

    /flutter (31446): The following assertion was thrown during a scheduler callback:
    I/flutter (31446): Controller's length property (9) does not match the number of
    I/flutter (31446): tabs (17) present in TabBar's tabs property.
    I/flutter (31446): 
    I/flutter (31446): When the exception was thrown, this was the stack:
    I/flutter (31446): #0      _TabBarState._debugScheduleCheckHasValidTabsCount.<anonymous closure>.<anonymous closure> (package:flutter/src/material/tabs.dart:1162:11)
    I/flutter (31446): #1      _TabBarState._debugScheduleCheckHasValidTabsCount.<anonymous closure> (package:flutter/src/material/tabs.dart:1168:8)
    I/flutter (31446): #2      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1175:15)
    I/flutter (31446): #3      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1113:9)
    I/flutter (31446): #4      SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1015:5)
    I/flutter (31446): #8      _invoke (dart:ui/hooks.dart:150:10)
    I/flutter (31446): #9      PlatformDispatcher._drawFrame
    

    The bug was not in version 1.3.1 of this library.

    bug 
    opened by LostInDarkMath 7
  • Performance and usability improvements

    Performance and usability improvements

    Hi,

    I went quite far with this PR. Let me know if you feel like this deviates too much from your original vision, I'll publish my fork under a different name. I wanted to address two issues before using this library in my project: performance (scroll lag) and compatibility (icons support, specifically on Android: some icons while technically exist in system fonts, don't have a colored version) emojis

    So, here is the list of my changes (at least noteworthy ones):

    Performace-related

    • removed shrinkWrap property from the GridView (not sure what was the reason for adding it, but it can impact performance)
    • refactored emoji cells into using InkWell instead of buttons for ButtonMode.MATERIAL mode (very noticeable scrolling performance boost)
    • added ButtonMode.NONE. The biggest scrolling performance hinder comes out of using buttons inside GridView. Clients may now opt for using a plain GestureDetector for cells which gives butter-smooth scrolling, sacrificing visual touch response on cells.
    • refactored TriangleShape into Decoration. Does not improve performance that much, but still saves a couple of widgets and makes the code cleaner.

    Code simplification

    • refactored raw data from lists of Strings to direct initialization of list of categories with Emoji objects (also applied the fix for the incorrect koala face position). This change allows to (a) maintain raw data easier, because now the emoji character, its name, and skin support are all in one place; (b) build a manageable way of providing custom set of emojis by the host app; (c) remove a lot of initialization code.
    • refactored Android "support check", mainly to make it compatible with the new raw data structure.
    • removed caching of supported emojis in SharedPreferences. In my tests, checking for compatibility only takes around 100-120ms. Considering that initialization is not blocking widget tree building, with Offstage widget happens before user gets a chance to see any picker UI, and retrieving the first instance of SharedPreferences alone takes 3 times longer, I think this optimization was unnecessary. Removing it allows to get rid of emojis versioning and simplifies initialization code even further.

    Compatibility

    • added a way to customize emoji set. Host app can use this to only allow emojis that are guaranteed to be supported by their target platforms. Or filter out emojis that users don't like for cultural reasons. Or add more emojis without waiting for library update.
    • added a way to set a custom emoji text style. Allows to use custom font for emojis either with GoogleFonts package or with a font bundled with the app.
    • added EmojiTextEditingController class that can be used to apply the same custom emoji font to a TextField input.
    • provided an example of using library method EmojiPickerUtils.setEmojiTextStyle to apply custom emoji font to a RichText widget.

    General usability

    • added a setting to disable Android emoji compatibility check. If the host app is targeting platforms that are guaranteed to have support of all emojis, use custom font or a limited set of emojis, the check is unnecessary and may save some initialization time.
    • provided an example of inserting emojis with EditableTextState that properly updates scroll position of a TextField, see comment for _onEmojiSelected method in the example for more details.
    • removed progress indicator and related setting. Initialization on my not that performant device never takes longer than 0.5s and happens offscreen, having the progress indicator with customizable color only adds confusion, in my opinion.

    Preview of the result.

    emojis2

    opened by yendacoder 6
  • [WIP] Add Web support

    [WIP] Add Web support

    This PR adds Web to the list of supported Platforms.

    Issue: #2

    Open Issues:

    • When using custom fonts, Emoji's are not correctly displayed in their text fields when selected. Solution would be custom RichTextInput like explained here https://stackoverflow.com/questions/44936239/displaying-text-with-emojis-on-flutter
    • (low priority) custom font doesn't work in android/ios, probably emoji needs to be rendered at the start of the app in order to trigger loading the custom font.
    opened by Fintasys 6
  • It loses its state on every parent setState()

    It loses its state on every parent setState()

    Hello!

    We went on beta (join it if you want hihi) and found a new issue. When the parent of the picker calls setState(), the emoji picker loses its state and goes back to the first page.

    Do you know any quick way to fix it? Or should we change the emoji picker itself and release a new version?

    Here's an example that showcases the issue. In this case, when we scroll the list, we call a setState() to show or hide the FAB. Now I'm going to do it with a ValueNotifier to avoid that setState() only for a part of the screen, but well, the issue is there.

    EmojiPickerIssue2

    As usual, thanks for the plugin and the support! 👍

    waiting for response 
    opened by rocboronat 6
  • [technical] Fix warnings for Flutter 3 and update dependencies

    [technical] Fix warnings for Flutter 3 and update dependencies

    This should fix the hot reload issue some projects encountered because of the deprecated warnings.

    Tickets

    Closes #71

    Changes

    • Update packages
    • Remove unnecessary null aware checks
    waiting for response 
    opened by joshuadeguzman 5
  • Flutter 3 fix

    Flutter 3 fix

    In Flutter 3, WidgetsBinding.instance no longer requires a null safety check.

    : Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
    ../…/src/emoji_picker.dart:164
    - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../bin/flutter/packages/flutter/lib/src/widgets/binding.dart').
    package:flutter/…/widgets/binding.dart:1
            (value) => WidgetsBinding.instance!.addPostFrameCallback((_) {
    
    opened by fennelhans 4
  • Added const keyword and background container to loading indicator

    Added const keyword and background container to loading indicator

    Hi @Fintasys, I added a const keyword to the EmojiPicker and a Container to the CircularLoadingIndicator. The reason for this is I use the EmojiPickerWidget sometimes with a transparent background. After evaluate every option I came to the conclusion that the best solution for this is to modify your library and add the Container.

    I also tried to run your example and I had some issues. Therefore, I do some modifications the build.gradle files to make it work.

    Let me know if you agree with my changes :)

    waiting for response 
    opened by LostInDarkMath 4
  • There is a bug in the new version 1.1.0

    There is a bug in the new version 1.1.0

    I/flutter (21183): type 'Null' is not a subtype of type 'bool' in type cast I/flutter (21183): #0 Emoji.fromJson (package:emoji_picker_flutter/src/emoji.dart:30:40) I/flutter (21183): #1 RecentEmoji.fromJson (package:emoji_picker_flutter/src/recent_emoji.dart:20:13) I/flutter (21183): #2 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31) I/flutter (21183): #3 ListIterator.moveNext (dart:_internal/iterable.dart:342:26) I/flutter (21183): #4 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:188:27) I/flutter (21183): #5 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28) I/flutter (21183): #6 new List.of (dart:core-patch/array_patch.dart:51:28) I/flutter (21183): #7 ListIterable.toList (dart:_internal/iterable.dart:213:44) I/flutter (21183): #8 EmojiPickerInternalUtils.getRecentEmojis (package:emoji_picker_flutter/src/emoji_picker_internal_utils.dart:136:56) I/flutter (21183): <asynchronous suspension> I/flutter (21183): #9 EmojiPickerState._updateEmojis (package:emoji_picker_flutter/src/emoji_picker.dart:214:22) I/flutter (21183): <asynchronous suspension> I/flutter (21183): ----------------------------------------------------

    opened by cnkygmr 4
  • Add option to change the animation duration for tabcontoller

    Add option to change the animation duration for tabcontoller

    I would love to change the animation duration from one page to another in the Config. We could just add an attribute Duration animationDuration or Duration pageChangeDuration to the config and pass it to the animateTo function here.

    opened by guenth39 4
  • Missing unicode 14.0.0 emojis

    Missing unicode 14.0.0 emojis

    I believe I'm using the latest version. I noticed several emojis are missing from the iOS set, including 🫡. Peculiarly, I see this unhappy fellow in the list as of 1.5.0: image

    opened by maxkrieger 7
Releases(v1.5.1)
  • v1.5.1(Nov 22, 2022)

  • v1.5.0(Oct 17, 2022)

  • v1.4.1(Oct 17, 2022)

  • v1.4.0(Sep 29, 2022)

    • Add support for custom fonts ✍️ (thx @yendacoder)
    • Refactor to make components reusable and add example for search (thx @yendacoder)
    • Breaking: Remove progressIndicatorColor in favor of loadingIndicator in Config
    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(Aug 2, 2022)

  • v1.3.0(Jun 11, 2022)

    • Compatibility for Flutter 3 and update dependencies 💙
    • Introduce property replaceEmojiOnLimitExceed to replace least used emoji in Recents when the list is full
    • Add property gridPadding to make GridView padding configurable
    • Add same background color of emoji view to background of loading indicator
    • Improvements for usage of custom view
    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(May 24, 2022)

  • v1.2.0(May 24, 2022)

  • v1.1.2(Feb 16, 2022)

  • v1.1.1(Jan 26, 2022)

  • v1.1.0(Jan 25, 2022)

    • New feature: EmojiPickerUtils provide access to recent emojis, search emoji and adding emoji to recently-used list
    • New feature: Skin-Tone Support
    • New feature: Emoji-List Versioning (force update users cached emoji's if necessary between versions)
    • Add Support for MacOS platform 🖥
    Source code(tar.gz)
    Source code(zip)
  • v1.0.8(Nov 18, 2021)

  • v1.0.7(Aug 30, 2021)

    • Align center NoRecent-Text
    • Enable Hot Reload for config changes
    • Add hint to example code how to fix emoji size issue for iOS
    • Add attribute tabIndicatorAnimDuration to config to control tab indicator animation duration
    • Fix issue with iOS hover effect
    • Format & Cleanup
    Source code(tar.gz)
    Source code(zip)
  • v1.0.6(May 30, 2021)

    • Fix appearance of emoji when device display size is not default 👀
    • Fix issue with GridView padding at the top when no AppBar exist in Scaffold
    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(May 14, 2021)

    • Fix appearance of emoji when device font size is not default #11 🖥
    • Add Backspace-Button & OnBackspacePressed-Callback for easier deletion of added Emoji's #10
    Source code(tar.gz)
    Source code(zip)
  • v1.0.4(Apr 24, 2021)

  • v1.0.3(Apr 4, 2021)

  • v1.0.2(Mar 20, 2021)

  • v1.0.1(Mar 16, 2021)

Owner
Stefan Humm
Software Developer from Germany living in Tokyo
Stefan Humm
This package provides some widgets you can use to create a smooshy UI.

Dough Library Squishy widgets for Flutter. Quick Links Dough Demos Here are a few samples of the different widgets provided by this repo. You can find

Josiah Saunders 530 Dec 23, 2022
A simple package that provides you with some widgets and cutom clippers which implements the shape of a coupon card.

Coupon UI Kit A simple package that provides you with some widgets and cutom clippers which implements the shape of a coupon card. The example contain

AbdulMuaz Aqeel 15 Dec 20, 2022
HSV(HSB)/HSL/RGB/Material color picker inspired by all the good design for your amazing flutter apps.

flutter_colorpicker HSV(HSB)/HSL/RGB/Material color picker inspired by all the good design for your amazing flutter apps. Adorable color pickers out o

Dark Knight 279 Dec 30, 2022
An assets picker in WeChat style, support multi assets picking.

An assets picker in WeChat style, support multi assets picking.

FlutterCandies 1.1k Dec 30, 2022
DirectSelect is a selection widget with an ethereal, full-screen modal popup displaying the available choices when the widget is interact with. https://dribbble.com/shots/3876250-DirectSelect-Dropdown-ux

direct-select-flutter DirectSelect is a selection widget with an ethereal, full-screen modal popup displaying the available choices when the widget is

null 582 Jan 4, 2023
A simple animated radial menu widget for Flutter.

flutter_radial_menu A radial menu widget for Flutter. . Installation Install the latest version from pub. Quick Start Import the package, create a Rad

Victor Choueiri 434 Jan 7, 2023
Custom widget for Flutter

Flushbar Use this package if you need more customization when notifying your user. For Android developers, it is made to substitute toasts and snackba

Andre Haueisen 899 Dec 30, 2022
flutter stepper_touch widget

stepper_touch the concept of the widget inspired from Nikolay Kuchkarov. i extended the functionality to be more useful in real world applications Tha

Raouf Rahiche 271 Dec 30, 2022
A TypeAhead widget for Flutter, where you can show suggestions to users as they type

Flutter TypeAhead A TypeAhead (autocomplete) widget for Flutter, where you can show suggestions to users as they type Features Shows suggestions in an

null 661 Jan 5, 2023
A highly customisable Flutter widget for entering pin code. Suitable for use cases such as login and OTP.

pin_code_text_field It's a beautiful and highly customizable Flutter widget for entering pin code. Suitable for use cases such as login and OTP. Usage

Liew Jun Tung 309 Dec 28, 2022
Flutter FoldingCell widget

Simple FoldingCell widget Simple folding cell widget, pass frontWidget and innerWidget to fold and unfold. Installation Add dependency in pubspec.yaml

Farrukh 513 Dec 30, 2022
A Flutter Widget Approach for using HTML tags & CSS styles in your upcoming Apps.

html_widgets A Flutter Widget Approach for using HTML tags & CSS styles in your upcoming Apps. Text Widgets *text property is required for all the tex

XenonLabz 7 Jul 14, 2022
Flutter widget with pond ripple effect!

Ripple pond effect This project contains Ripple pond effect widget. It makes wave when you click on it! There is still many things to improve in this

null 24 Dec 19, 2021
top-snackbar-flutter - Modern UI snackbar widget

top-snackbar-flutter - Modern UI snackbar widget

null 110 Jan 7, 2023
A flutter widget where a card is expanded ontap.

Expansion card This package provides an easy implementation of a Expansion type card where you can also add gif at the background. How to use import '

null 127 Dec 6, 2022
Scratch card widget which temporarily hides content from user.

scratcher Scratch card widget which temporarily hides content from user. Features Android and iOS support Cover content with full color or custom imag

Kamil Rykowski 405 Dec 27, 2022
A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file.

image_sequence_animator A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file. If you have a G

AliYigitBireroglu 134 Dec 22, 2022
Animated Selection Slide Sezgin BilgetayAnimated Selection Slide An animated selection widget by swiping by Sezgin Bilgetay.

Animated Selection Slide This flutter project allows you to make your choices with animation in inbox. For UI, it's inspired by the great example on d

null 340 Jan 7, 2023
A Very Good Infinite List Widget created by Very Good Ventures. Great for activity feeds, news feeds, etc. 🦄

InfiniteList comes in handy when building features like activity feeds, news feeds, or anywhere else where you need to lazily fetch and render content for users to consume.

Very Good Open Source 102 Dec 12, 2022