skip to Main Content

I want to make an emoji picker.

I’ve searched Google and referred some Stack Overflow questions, but still can’t do it.

I’ve used the code from this answer, but it doesn’t work. It shows blank (not white, it’s transparent)

My code:

Offstage(
  offstage: false,
  child: SizedBox(
    height: 250,
    child: EmojiPicker(
      onEmojiSelected: (category, emoji) {
        messageTextController.text = messageTextController.text + emoji.emoji;
      },
      onBackspacePressed: () {},
      config: Config(
        columns: 7,
        verticalSpacing: 0,
        horizontalSpacing: 0,
        initCategory: Category.SMILEYS,
        bgColor: AppColors.kIconColor,
        indicatorColor: Colors.blue,
        iconColor: Colors.grey,
        iconColorSelected: Colors.blue,
        showRecentsTab: true,
        recentsLimit: 28,
        tabIndicatorAnimDuration: kTabScrollDuration,
        categoryIcons: const CategoryIcons(),
        buttonMode: kIsWeb || Platform.isAndroid ? ButtonMode.MATERIAL : ButtonMode.CUPERTINO,
      ),
    ),
  ),
),

How do I make an emoji picker in Flutter?

2

Answers


  1. dependencies:
      emoji_picker_flutter: ^1.4.1
    

    Add this Version hope now it will work

    Login or Signup to reply.
  2. The package you are using has been discontinued 2 years ago and it doesn’t even support null safety so it is bound to fail at some point. What you should do instead is try searching pub.dev for other emoji pickers if created by other developers like this one: emoji_picker_flutter: ^1.5.1 and there are others as well if you have trouble in this one(which you won’t) at pub.dev as I mentioned above

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search