fetch emoji list from gemoji for a more complete emoji list

This commit is contained in:
Henry Hiles 2026-04-13 22:44:22 -04:00
commit 313dc377ec
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
4 changed files with 131 additions and 19 deletions

View file

@ -1,8 +1,9 @@
import "package:emoji_text_field/emoji_text_field.dart";
import "package:flutter/material.dart";
import "package:flutter_hooks/flutter_hooks.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:nexus/controllers/emoji_controller.dart";
class EmojiPickerButton extends HookWidget {
class EmojiPickerButton extends HookConsumerWidget {
final TextEditingController? controller;
final void Function(String emoji)? onSelection;
final VoidCallback? onPressed;
@ -16,25 +17,31 @@ class EmojiPickerButton extends HookWidget {
});
@override
Widget build(_) => IconButton(
onPressed: () {
Widget build(_, WidgetRef ref) => IconButton(
onPressed: () async {
onPressed?.call();
final controller = this.controller ?? TextEditingController();
showModalBottomSheet(
context: context,
builder: (context) => EmojiKeyboardView(
config: EmojiViewConfig(
showRecentTab: false,
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
height: 600,
final emojis = await ref.watch(EmojiController.provider.future);
if (context.mounted) {
showModalBottomSheet(
context: context,
builder: (context) => EmojiKeyboardView(
config: EmojiViewConfig(
showRecentTab: false,
customCategories: emojis.$1.unlock,
customKeywords: emojis.$2.unlock,
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
height: 600,
),
textController: controller
..addListener(() async {
Navigator.of(context).pop();
onSelection?.call(controller.text);
}),
),
textController: controller
..addListener(() async {
Navigator.of(context).pop();
onSelection?.call(controller.text);
}),
),
);
);
}
},
icon: Icon(Icons.emoji_emotions),
);