diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eeb3e2..f4b69c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,3 +45,11 @@ Fixup gemoji URL in README. - **Breaking:** `onSelection` is now called with the selected `Emoji`, including its aliases, instead of its value. - **Breaking:** Replace `allowFreeText` and `isFreeText` with an optional `onFreeText` callback, called with the search text. The send button is shown when it's set. + +## 2.0.1 + +- Add `includeDefaultEmoji`, to show only your own categories, e.g. for a sticker picker. The default emoji aren't loaded when it's `false`. +- Add `itemSize`, to set the size of each item in the grid. +- Add `searchHint`, to set the search bar's placeholder text. +- Add an optional `data` field to `Emoji`, for anything else your app needs about a custom emoji. It's passed back as is to `onSelection`. +- Fix changes to categories after the picker is first built not being shown, e.g. custom emojis that finish loading later. diff --git a/README.md b/README.md index 2cc06d4..4ed9ad8 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,19 @@ Emoji( aliases: ['blob'], description: 'Blob', tags: ['custom', 'blob'], + data: blobImage, // Optional, passed back to onSelection +) +``` + +To pick from only your own categories, like a sticker picker, turn off the default emojis: + +```dart +EmojiPicker( + prependCategories: stickerCategories, + includeDefaultEmoji: false, + itemSize: 96, + searchHint: "Search stickers", + onSelection: (sticker) => sendSticker(sticker.data as StickerImage), ) ``` @@ -55,3 +68,6 @@ Emoji( - `IList appendCategories`: Categories to append to the default emoji list - `required FutureOr Function(Emoji emoji) onSelection`: Function to be called with the selected emoji - `FutureOr Function(String text)? onFreeText`: If set, allows submitting the search text as is, calling this with it +- `bool includeDefaultEmoji = true`: Whether to show the default emojis after `prependCategories` +- `double itemSize = 56`: The width and height of each item in the grid +- `String searchHint = "Search emoji"`: Placeholder text for the search bar diff --git a/pubspec.yaml b/pubspec.yaml index de3c6b7..fa1c1e2 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: 2.0.0 +version: 2.0.1 repository: https://git.federated.nexus/Henry-Hiles/material_emoji_picker issue_tracker: https://git.federated.nexus/Henry-Hiles/material_emoji_picker/issues