automatically replace emoji
This commit is contained in:
@@ -407,11 +407,11 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
final textToSelection = textEditingController.text
|
final textToSelection = textEditingController.text
|
||||||
.substring(0, textEditingController.value.selection.start);
|
.substring(0, textEditingController.value.selection.start);
|
||||||
final splits = textToSelection.split(':');
|
final splits = textToSelection.split(':');
|
||||||
final query = splits[1]?.toLowerCase();
|
final query = splits[splits.length - 2]?.toLowerCase();
|
||||||
final emoji = Emoji.byName(query);
|
final emoji = Emoji.byName(query);
|
||||||
|
|
||||||
if (textToSelection.endsWith(':') && emoji != null) {
|
if (textToSelection.endsWith(':') && emoji != null) {
|
||||||
_chooseEmoji(splits, emoji);
|
_chooseEmoji(splits.sublist(0, splits.length - 1), emoji);
|
||||||
} else {
|
} else {
|
||||||
_emojiOverlay = _buildEmojiOverlay();
|
_emojiOverlay = _buildEmojiOverlay();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user