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,
),
),
),
),
Feel free to leave a comment if you need more information.
How to make an emoji picker in Flutter? I would appreciate any help. Thank you in advance!
CodePudding user response:
dependencies:
emoji_picker_flutter: ^1.4.1
Add this Version hope now it will work
CodePudding user response:
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