diff --git a/lib/src/widgets/emoji_picker.dart b/lib/src/widgets/emoji_picker.dart index c07d4f9..178ab03 100644 --- a/lib/src/widgets/emoji_picker.dart +++ b/lib/src/widgets/emoji_picker.dart @@ -9,36 +9,25 @@ import "package:material_emoji_picker/src/controllers/emoji.dart"; import "package:material_emoji_picker/src/models/emoji.dart"; import "package:material_emoji_picker/src/models/emoji_category.dart"; -class EmojiPicker extends HookConsumerWidget { - const EmojiPicker({ - this.prependCategories = const IList.empty(), - this.appendCategories = const IList.empty(), - required this.onSelection, - this.onFreeText, - this.includeDefaultEmoji = true, - this.itemSize = 56, - this.searchHint = "Search emoji", - super.key, - }); - - final IList prependCategories; - final IList appendCategories; +class const EmojiPicker({ + final IList prependCategories = const .empty(), + final IList appendCategories = const .empty(), /// Called with the emoji that was selected. - final FutureOr Function(Emoji emoji) onSelection; + required final FutureOr Function(Emoji emoji) onSelection, /// If set, the search text can be submitted as is, calling this with it. - final FutureOr Function(String text)? onFreeText; + final FutureOr Function(String text)? onFreeText, /// Whether to show the default unicode emoji after [prependCategories], /// e.g. false for a sticker picker of only custom categories. - final bool includeDefaultEmoji; + final bool includeDefaultEmoji = true, /// The width and height of each item in the grid. - final double itemSize; - - final String searchHint; - + final double itemSize = 56, + final String searchHint = "Search emoji", + super.key, +}) extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final selectedCategory = useState(0);