diff --git a/CHANGELOG.md b/CHANGELOG.md index efc8a61..5d8377c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,3 +32,7 @@ Wait for end of frame before highlighting categories, fixing an issue where cate ## 1.1.2 Make search case-insensitive. + +## 1.2.0 + +Add `isFreeText` to `onSelection` callback, useful for recording only recent emojis and not text reactions. diff --git a/README.md b/README.md index 4176040..1b6c412 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ showModalBottomSheet( isScrollControlled: true, context: context, builder: (context) => EmojiPicker( - onSelection: (emoji) { + onSelection: (emoji, isFreeText) { Navigator.of(context).pop(); message.sendReaction(emoji); }, diff --git a/lib/src/widgets/emoji_picker.dart b/lib/src/widgets/emoji_picker.dart index 69e6beb..8bf1c91 100644 --- a/lib/src/widgets/emoji_picker.dart +++ b/lib/src/widgets/emoji_picker.dart @@ -19,7 +19,7 @@ class EmojiPicker extends HookConsumerWidget { final IList prependCategories; final IList appendCategories; - final FutureOr Function(String value) onSelection; + final FutureOr Function(String value, bool isFreeText) onSelection; final bool allowFreeText; @override @@ -113,7 +113,7 @@ class EmojiPicker extends HookConsumerWidget { IconButton( onPressed: search.value.isEmpty ? null - : () => onSelection(search.value), + : () => onSelection(search.value, true), icon: Icon(Icons.send), ), ], @@ -214,7 +214,7 @@ class EmojiPicker extends HookConsumerWidget { return IconButton( padding: EdgeInsets.zero, onPressed: () => - onSelection(emoji.value), + onSelection(emoji.value, false), icon: SizedBox.square( dimension: 36, child: FittedBox(child: emoji.widget), diff --git a/pubspec.yaml b/pubspec.yaml index b29bd70..9096b71 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: material_emoji_picker description: A generic but configurable emoji picker for Flutter -version: 1.1.2 +version: 1.2.0 repository: https://git.federated.nexus/Henry-Hiles/material_emoji_picker issue_tracker: https://git.federated.nexus/Henry-Hiles/material_emoji_picker/issues