JeffG05 / emoji_picker

A Flutter package that provides an Emoji Keyboard widget
https://pub.dev/packages/emoji_picker
BSD 2-Clause "Simplified" License
84 stars 91 forks source link

Feature request: Option to hide the recent page would be nice #25

Open Ajaystefin opened 4 years ago

Ajaystefin commented 4 years ago

The recent section does not work well. It would be nice to have a disable option

blisssan commented 4 years ago

I will try to make a PR for this soon, but it seems like the maintainer is not working on it any more. I made couple of PR 2 weeks ago, but no comments on it yet.

michaelopes commented 3 years ago

Hello, I finded a temporary solution for this issue.

like above: import 'package:emoji_picker/emoji_picker.dart' as emoji;

Create a GlobalKey: final key = new GlobalKey<State>();

Final code like above:

Widget buildSticker() {
    picker = emoji.EmojiPicker(
      key: key,
      bgColor: ColorsConst.bg,
      indicatorColor: ColorsConst.primary,
      selectedCategory: emoji.Category.RECENT,
      rows: 3,
      columns: 7,
      buttonMode: emoji.ButtonMode.MATERIAL,
      recommendKeywords: [],
      numRecommended: 10,
      onEmojiSelected: (emoji, category) {
        (key.currentState as dynamic).addRecentEmoji(emoji);
        //createState().addRecentEmoji(emoji);
      },
    );
    return picker;
  }