diff --git a/CHANGELOG.md b/CHANGELOG.md
index d8d0433..293fac1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
## 1.0.5
* Fix appearance of emoji when device font size is not default ๐ฅ
+* Add Backspace-Button & OnBackspacePressed-Callback for easier deletion of added Emoji's
## 1.0.4
diff --git a/README.md b/README.md
index b71e971..c64c612 100644
--- a/README.md
+++ b/README.md
@@ -29,6 +29,10 @@ EmojiPicker(
onEmojiSelected: (category, emoji) {
// Do something when emoji is tapped
},
+ onBackspacePressed: () {
+ // Backspace-Button tapped logic
+ // Remove this line to also remove the button in the UI
+ },
config: Config(
columns: 7,
emojiSizeMax: 32.0,
@@ -66,6 +70,7 @@ See the [demo](https://github.com/Fintasys/emoji_picker_flutter/blob/master/exam
| iconColor | The color of the category icons | Colors.grey |
| iconColorSelected | The color of the category icon when selected | Colors.blue |
| progressIndicatorColor | The color of the loading indicator during initalization | Colors.blue |
+| backspaceColor | The color of the backspace icon button | Colors.blue |
| showRecentsTab | Show extra tab with recently used emoji | true |
| recentsLimit | Limit of recently used emoji that will be saved | 28 |
| noRecentsText | The text to be displayed if no recent emojis to display | "No Recents" |
@@ -73,6 +78,11 @@ See the [demo](https://github.com/Fintasys/emoji_picker_flutter/blob/master/exam
| categoryIcons | Determines the icon to display for each Category. You can change icons by setting them in the constructor. | CategoryIcons() |
| buttonMode | Choose between Material and Cupertino button style | ButtonMode.MATERIAL |
+## Backspace-Button
+You can add an Backspace-Button to the end category list by adding the callback method `onBackspacePressed: () { }` to the EmojiPicker-Widget. This will make it easier for your user to remove an added Emoji without showing the keyboard. Check out the example for more details about usage.
+
+
+
## Custom view
The appearance is completely customizable by setting `customWidget` property. If properties in Config are not enough you can inherit from `EmojiPickerBuilder` (recommended but not necessary) to make further adjustments.
```
diff --git a/example/lib/main.dart b/example/lib/main.dart
index 483a528..a33d20f 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -15,6 +15,20 @@ class _MyAppState extends State {
final TextEditingController _controller = TextEditingController();
bool emojiShowing = false;
+ _onEmojiSelected(Emoji emoji) {
+ _controller
+ ..text += emoji.emoji
+ ..selection = TextSelection.fromPosition(
+ TextPosition(offset: _controller.text.length));
+ }
+
+ _onBackspacePressed() {
+ _controller
+ ..text = _controller.text.characters.skipLast(1).toString()
+ ..selection = TextSelection.fromPosition(
+ TextPosition(offset: _controller.text.length));
+ }
+
@override
Widget build(BuildContext context) {
return MaterialApp(
@@ -86,11 +100,9 @@ class _MyAppState extends State {
height: 250,
child: EmojiPicker(
onEmojiSelected: (Category category, Emoji emoji) {
- _controller
- ..text += emoji.emoji
- ..selection = TextSelection.fromPosition(
- TextPosition(offset: _controller.text.length));
+ _onEmojiSelected(emoji);
},
+ onBackspacePressed: _onBackspacePressed,
config: const Config(
columns: 7,
emojiSizeMax: 32.0,
@@ -102,6 +114,7 @@ class _MyAppState extends State {
iconColor: Colors.grey,
iconColorSelected: Colors.blue,
progressIndicatorColor: Colors.blue,
+ backspaceColor: Colors.blue,
showRecentsTab: true,
recentsLimit: 28,
noRecentsText: 'No Recents',
diff --git a/example/pubspec.lock b/example/pubspec.lock
index 4054f8e..5f445d4 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -2,7 +2,7 @@
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
characters:
- dependency: transitive
+ dependency: "direct main"
description:
name: characters
url: "https://pub.dartlang.org"
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index 0229f53..6188a04 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -8,6 +8,7 @@ environment:
dependencies:
flutter:
sdk: flutter
+ characters: ^1.1.0
emoji_picker_flutter:
path: ../
diff --git a/lib/src/config.dart b/lib/src/config.dart
index b40b43d..0ad5cee 100644
--- a/lib/src/config.dart
+++ b/lib/src/config.dart
@@ -18,6 +18,7 @@ class Config {
this.iconColor = Colors.grey,
this.iconColorSelected = Colors.blue,
this.progressIndicatorColor = Colors.blue,
+ this.backspaceColor = Colors.blue,
this.showRecentsTab = true,
this.recentsLimit = 28,
this.noRecentsText = 'No Recents',
@@ -58,6 +59,9 @@ class Config {
/// The color of the loading indicator during initalization
final Color progressIndicatorColor;
+ /// The color of the backspace icon button
+ final Color backspaceColor;
+
/// Show extra tab with recently used emoji
final bool showRecentsTab;
diff --git a/lib/src/default_emoji_picker_view.dart b/lib/src/default_emoji_picker_view.dart
index 5a56fc1..5144bdf 100644
--- a/lib/src/default_emoji_picker_view.dart
+++ b/lib/src/default_emoji_picker_view.dart
@@ -36,6 +36,24 @@ class _DefaultEmojiPickerViewState extends State
super.initState();
}
+ Widget _buildBackspaceButton() {
+ if (widget.state.onBackspacePressed != null) {
+ return Material(
+ type: MaterialType.transparency,
+ child: IconButton(
+ padding: const EdgeInsets.only(bottom: 2),
+ icon: Icon(
+ Icons.backspace,
+ color: widget.config.backspaceColor,
+ ),
+ onPressed: () {
+ widget.state.onBackspacePressed!();
+ }),
+ );
+ }
+ return Container();
+ }
+
@override
Widget build(BuildContext context) {
return LayoutBuilder(
@@ -46,21 +64,28 @@ class _DefaultEmojiPickerViewState extends State
color: widget.config.bgColor,
child: Column(
children: [
- TabBar(
- labelColor: widget.config.iconColorSelected,
- indicatorColor: widget.config.indicatorColor,
- unselectedLabelColor: widget.config.iconColor,
- controller: _tabController,
- labelPadding: EdgeInsets.zero,
- onTap: (index) {
- _pageController!.jumpToPage(index);
- },
- tabs: widget.state.categoryEmoji
- .asMap()
- .entries
- .map(
- (item) => _buildCategory(item.key, item.value.category))
- .toList(),
+ Row(
+ children: [
+ Expanded(
+ child: TabBar(
+ labelColor: widget.config.iconColorSelected,
+ indicatorColor: widget.config.indicatorColor,
+ unselectedLabelColor: widget.config.iconColor,
+ controller: _tabController,
+ labelPadding: EdgeInsets.zero,
+ onTap: (index) {
+ _pageController!.jumpToPage(index);
+ },
+ tabs: widget.state.categoryEmoji
+ .asMap()
+ .entries
+ .map((item) =>
+ _buildCategory(item.key, item.value.category))
+ .toList(),
+ ),
+ ),
+ _buildBackspaceButton(),
+ ],
),
Flexible(
child: PageView.builder(
diff --git a/lib/src/emoji_lists.dart b/lib/src/emoji_lists.dart
index 8d85ec5..8bd2dbf 100644
--- a/lib/src/emoji_lists.dart
+++ b/lib/src/emoji_lists.dart
@@ -429,8 +429,8 @@ final Map smileys = Map.fromIterables([
'๐',
'๐',
'๐',
- 'โน\ufe0f',
- '\ud83d\udea3',
+ 'โน๏ธ',
+ '๐ฃ',
'๐ฏ',
'๐ฒ',
'๐ณ',
@@ -526,82 +526,82 @@ final Map smileys = Map.fromIterables([
'๐ง',
'๐จ',
'๐ง',
- '๐ฑ\u200dโ๏ธ',
- '๐จ\u200d๐ฆฐ',
- '๐จ\u200d๐ฆฑ',
- '๐จ\u200d๐ฆณ',
- '๐จ\u200d๐ฆฒ',
+ '๐ฑ',
+ '๐จโ๐ฆฐ',
+ '๐จโ๐ฆฑ',
+ '๐จโ๐ฆณ',
+ '๐จโ๐ฆฒ',
'๐ฉ',
- '๐ฑ\u200dโ๏ธ',
- '๐ฉ\u200d๐ฆฐ',
- '๐ฉ\u200d๐ฆฑ',
- '๐ฉ\u200d๐ฆณ',
- '๐ฉ\u200d๐ฆฒ',
+ '๐ฑ',
+ '๐ฉโ๐ฆฐ',
+ '๐ฉโ๐ฆฑ',
+ '๐ฉโ๐ฆณ',
+ '๐ฉโ๐ฆฒ',
'๐ง',
'๐ด',
'๐ต',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐
\u200dโ๏ธ',
- '๐
\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐คฆ\u200dโ๏ธ',
- '๐คฆ\u200dโ๏ธ',
- '๐คท\u200dโ๏ธ',
- '๐คท\u200dโ๏ธ',
- '๐จ\u200dโ๏ธ',
- '๐ฉ\u200dโ๏ธ',
- '๐จ\u200d๐',
- '๐ฉ\u200d๐',
- '๐จ\u200d๐ซ',
- '๐ฉ\u200d๐ซ',
- '๐จ\u200dโ๏ธ',
- '๐ฉ\u200dโ๏ธ',
- '๐จ\u200d๐พ',
- '๐ฉ\u200d๐พ',
- '๐จ\u200d๐ณ',
- '๐ฉ\u200d๐ณ',
- '๐จ\u200d๐ง',
- '๐ฉ\u200d๐ง',
- '๐จ\u200d๐ญ',
- '๐ฉ\u200d๐ญ',
- '๐จ\u200d๐ผ',
- '๐ฉ\u200d๐ผ',
- '๐จ\u200d๐ฌ',
- '๐ฉ\u200d๐ฌ',
- '๐จ\u200d๐ป',
- '๐ฉ\u200d๐ป',
- '๐จ\u200d๐ค',
- '๐ฉ\u200d๐ค',
- '๐จ\u200d๐จ',
- '๐ฉ\u200d๐จ',
- '๐จ\u200dโ๏ธ',
- '๐ฉ\u200dโ๏ธ',
- '๐จ\u200d๐',
- '๐ฉ\u200d๐',
- '๐จ\u200d๐',
- '๐ฉ\u200d๐',
- '๐ฎ\u200dโ๏ธ',
- '๐ฎ\u200dโ๏ธ',
- '๐ต๏ธ\u200dโ๏ธ',
- '๐ต๏ธ\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐ท\u200dโ๏ธ',
- '๐ท\u200dโ๏ธ',
+ '๐',
+ '๐',
+ '๐',
+ '๐',
+ '๐
',
+ '๐
',
+ '๐',
+ '๐',
+ '๐',
+ '๐',
+ '๐',
+ '๐',
+ '๐',
+ '๐',
+ '๐คฆ',
+ '๐คฆ',
+ '๐คท',
+ '๐คท',
+ '๐จโโ๏ธ',
+ '๐ฉโโ๏ธ',
+ '๐จโ๐',
+ '๐ฉโ๐',
+ '๐จโ๐ซ',
+ '๐ฉโ๐ซ',
+ '๐จโโ๏ธ',
+ '๐ฉโโ๏ธ',
+ '๐จโ๐พ',
+ '๐ฉโ๐พ',
+ '๐จโ๐ณ',
+ '๐ฉโ๐ณ',
+ '๐จโ๐ง',
+ '๐ฉโ๐ง',
+ '๐จโ๐ญ',
+ '๐ฉโ๐ญ',
+ '๐จโ๐ผ',
+ '๐ฉโ๐ผ',
+ '๐จโ๐ฌ',
+ '๐ฉโ๐ฌ',
+ '๐จโ๐ป',
+ '๐ฉโ๐ป',
+ '๐จโ๐ค',
+ '๐ฉโ๐ค',
+ '๐จโ๐จ',
+ '๐ฉโ๐จ',
+ '๐จโโ๏ธ',
+ '๐ฉโโ๏ธ',
+ '๐จโ๐',
+ '๐ฉโ๐',
+ '๐จโ๐',
+ '๐ฉโ๐',
+ '๐ฎ',
+ '๐ฎ',
+ '๐ต๏ธ',
+ '๐ต๏ธ',
+ '๐',
+ '๐',
+ '๐ท',
+ '๐ท',
'๐คด',
'๐ธ',
- '๐ณ\u200dโ๏ธ',
- '๐ณ\u200dโ๏ธ',
+ '๐ณ',
+ '๐ณ',
'๐ฒ',
'๐ง',
'๐คต',
@@ -611,75 +611,75 @@ final Map smileys = Map.fromIterables([
'๐ผ',
'๐
',
'๐คถ',
- '๐ฆธ\u200dโ๏ธ',
- '๐ฆธ\u200dโ๏ธ',
- '๐ฆน\u200dโ๏ธ',
- '๐ฆน\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐ถ\u200dโ๏ธ',
- '๐ถ\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
+ '๐ฆธ',
+ '๐ฆธ',
+ '๐ฆน',
+ '๐ฆน',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐ง',
+ '๐',
+ '๐',
+ '๐',
+ '๐',
+ '๐ถ',
+ '๐ถ',
+ '๐',
+ '๐',
'๐',
'๐บ',
'๐ด',
- '๐ฏ\u200dโ๏ธ',
- '๐ฏ\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
+ '๐ฏ',
+ '๐ฏ',
+ '๐ง',
+ '๐ง',
'๐ง',
'๐ญ',
'๐ซ',
'๐ฌ',
'๐',
- '๐จ\u200dโค๏ธ\u200d๐\u200d๐จ',
- '๐ฉ\u200dโค๏ธ\u200d๐\u200d๐ฉ',
+ '๐จโโค๏ธโ๐โ๐จ',
+ '๐ฉโโค๏ธโ๐โ๐ฉ',
'๐',
- '๐จ\u200dโค๏ธ\u200d๐จ',
- '๐ฉ\u200dโค๏ธ\u200d๐ฉ',
+ '๐จโโค๏ธโ๐จ',
+ '๐ฉโโค๏ธโ๐ฉ',
'๐ช',
- '๐จ\u200d๐ฉ\u200d๐ฆ',
- '๐จ\u200d๐ฉ\u200d๐ง',
- '๐จ\u200d๐ฉ\u200d๐ง\u200d๐ฆ',
- '๐จ\u200d๐ฉ\u200d๐ฆ\u200d๐ฆ',
- '๐จ\u200d๐ฉ\u200d๐ง\u200d๐ง',
- '๐จ\u200d๐จ\u200d๐ฆ',
- '๐จ\u200d๐จ\u200d๐ง',
- '๐จ\u200d๐จ\u200d๐ง\u200d๐ฆ',
- '๐จ\u200d๐จ\u200d๐ฆ\u200d๐ฆ',
- '๐จ\u200d๐จ\u200d๐ง\u200d๐ง',
- '๐ฉ\u200d๐ฉ\u200d๐ฆ',
- '๐ฉ\u200d๐ฉ\u200d๐ง',
- '๐ฉ\u200d๐ฉ\u200d๐ง\u200d๐ฆ',
- '๐ฉ\u200d๐ฉ\u200d๐ฆ\u200d๐ฆ',
- '๐ฉ\u200d๐ฉ\u200d๐ง\u200d๐ง',
- '๐จ\u200d๐ฆ',
- '๐จ\u200d๐ฆ\u200d๐ฆ',
- '๐จ\u200d๐ง',
- '๐จ\u200d๐ง\u200d๐ฆ',
- '๐จ\u200d๐ง\u200d๐ง',
- '๐ฉ\u200d๐ฆ',
- '๐ฉ\u200d๐ฆ\u200d๐ฆ',
- '๐ฉ\u200d๐ง',
- '๐ฉ\u200d๐ง\u200d๐ฆ',
- '๐ฉ\u200d๐ง\u200d๐ง',
+ '๐จโ๐ฉโ๐ฆ',
+ '๐จโ๐ฉโ๐ง',
+ '๐จโ๐ฉโ๐งโ๐ฆ',
+ '๐จโ๐ฉโ๐ฆโ๐ฆ',
+ '๐จโ๐ฉโ๐งโ๐ง',
+ '๐จโ๐จโ๐ฆ',
+ '๐จโ๐จโ๐ง',
+ '๐จโ๐จโ๐งโ๐ฆ',
+ '๐จโ๐จโ๐ฆโ๐ฆ',
+ '๐จโ๐จโ๐งโ๐ง',
+ '๐ฉโ๐ฉโ๐ฆ',
+ '๐ฉโ๐ฉโ๐ง',
+ '๐ฉโ๐ฉโ๐งโ๐ฆ',
+ '๐ฉโ๐ฉโ๐ฆโ๐ฆ',
+ '๐ฉโ๐ฉโ๐งโ๐ง',
+ '๐จโ๐ฆ',
+ '๐จโ๐ฆโ๐ฆ',
+ '๐จโ๐ง',
+ '๐จโ๐งโ๐ฆ',
+ '๐จโ๐งโ๐ง',
+ '๐ฉโ๐ฆ',
+ '๐ฉโ๐ฆโ๐ฆ',
+ '๐ฉโ๐ง',
+ '๐ฉโ๐งโ๐ฆ',
+ '๐ฉโ๐งโ๐ง',
'๐ฃ',
'๐ค',
'๐ฅ',
@@ -1659,39 +1659,39 @@ final Map activities = Map.fromIterables([
'Bow and Arrow'
], [
'๐ด',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
+ '๐ง',
+ '๐ง',
'๐',
'โท',
'๐',
- '๐๏ธ\u200dโ๏ธ',
- '๐๏ธ\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐ฃ\u200dโ๏ธ',
- '๐ฃ\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- '๐\u200dโ๏ธ',
- 'โน๏ธ\u200dโ๏ธ',
- 'โน๏ธ\u200dโ๏ธ',
- '๐๏ธ\u200dโ๏ธ',
- '๐๏ธ\u200dโ๏ธ',
- '๐ด\u200dโ๏ธ',
- '๐ด\u200dโ๏ธ',
- '๐ต\u200dโ๏ธ',
- '๐ต\u200dโ๏ธ',
- '๐คธ\u200dโ๏ธ',
- '๐คธ\u200dโ๏ธ',
- '๐คผ\u200dโ๏ธ',
- '๐คผ\u200dโ๏ธ',
- '๐คฝ\u200dโ๏ธ',
- '๐คฝ\u200dโ๏ธ',
- '๐คพ\u200dโ๏ธ',
- '๐คพ\u200dโ๏ธ',
- '๐คน\u200dโ๏ธ',
- '๐คน\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
- '๐ง\u200dโ๏ธ',
+ '๐๏ธ',
+ '๐๏ธ',
+ '๐',
+ '๐',
+ '๐ฃ',
+ '๐ฃ',
+ '๐',
+ '๐',
+ 'โน๏ธ',
+ 'โน๏ธ',
+ '๐๏ธ',
+ '๐๏ธ',
+ '๐ด',
+ '๐ด',
+ '๐ต',
+ '๐ต',
+ '๐คธ',
+ '๐คธ',
+ '๐คผ',
+ '๐คผ',
+ '๐คฝ',
+ '๐คฝ',
+ '๐คพ',
+ '๐คพ',
+ '๐คน',
+ '๐คน',
+ '๐ง๐ปโโ๏ธ',
+ '๐ง๐ปโโ๏ธ',
'๐ช',
'๐น',
'๐',
@@ -2435,7 +2435,7 @@ final Map symbols = Map.fromIterables([
'๐ฏ',
'๐ข',
'๐ฌ',
- '๐๏ธ\u200d๐จ๏ธ',
+ '๐๏ธโ๐จ๏ธ',
'๐ฏ',
'๐ญ',
'๐ค',
@@ -2949,8 +2949,8 @@ final Map flags = Map.fromIterables([
'๐',
'๐ด',
'๐ณ',
- '๐ณ๏ธ\u200d๐',
- '๐ด\u200dโ ๏ธ',
+ '๐ณ๏ธโ๐',
+ '๐ดโโ ๏ธ',
'๐ฆ๐จ',
'๐ฆ๐ฉ',
'๐ฆ๐ช',
diff --git a/lib/src/emoji_picker.dart b/lib/src/emoji_picker.dart
index 2e0d550..ec37aed 100644
--- a/lib/src/emoji_picker.dart
+++ b/lib/src/emoji_picker.dart
@@ -42,7 +42,7 @@ enum Category {
SYMBOLS,
/// Flag emojis
- FLAGS
+ FLAGS,
}
/// Enum to alter the keyboard button style
@@ -60,6 +60,9 @@ enum ButtonMode {
/// as the [Category] from which it originated
typedef void OnEmojiSelected(Category category, Emoji emoji);
+/// Callback function for backspace button
+typedef void OnBackspacePressed();
+
/// Callback function for custom view
typedef EmojiViewBuilder = Widget Function(Config config, EmojiViewState state);
@@ -75,6 +78,7 @@ class EmojiPicker extends StatefulWidget {
EmojiPicker({
Key? key,
required this.onEmojiSelected,
+ this.onBackspacePressed,
this.config = const Config(),
this.customWidget,
}) : super(key: key);
@@ -85,6 +89,9 @@ class EmojiPicker extends StatefulWidget {
/// The function called when the emoji is selected
final OnEmojiSelected onEmojiSelected;
+ /// The function called when backspace button is pressed
+ final OnBackspacePressed? onBackspacePressed;
+
/// Config for customizations
final Config config;
@@ -119,6 +126,7 @@ class _EmojiPickerState extends State {
var state = EmojiViewState(
categoryEmoji,
_getOnEmojiListener(),
+ widget.onBackspacePressed,
);
// Build
diff --git a/lib/src/emoji_view_state.dart b/lib/src/emoji_view_state.dart
index 4a0cbd3..a98e2ba 100644
--- a/lib/src/emoji_view_state.dart
+++ b/lib/src/emoji_view_state.dart
@@ -7,6 +7,7 @@ class EmojiViewState {
EmojiViewState(
this.categoryEmoji,
this.onEmojiSelected,
+ this.onBackspacePressed,
);
/// List of all category including their emoji
@@ -14,4 +15,7 @@ class EmojiViewState {
/// Callback when pressed on emoji
final OnEmojiSelected onEmojiSelected;
+
+ /// Callback when pressed on backspace
+ final OnBackspacePressed? onBackspacePressed;
}