Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent emojis did't work #31

Open
ghost opened this issue Sep 11, 2020 · 2 comments
Open

Recent emojis did't work #31

ghost opened this issue Sep 11, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 11, 2020

its always showing "NO Recent", version using 0.1.0

@michaelopes
Copy link

michaelopes commented Dec 4, 2020

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<emoji.EmojiPicker>>();

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;
  } 

@Sorunome
Copy link

Looking at the code the issue seems to be that recent emoji are only added within the recommended category https://github.com/JeffG05/emoji_picker/blob/master/lib/emoji_picker.dart#L576-L578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants