update dependencies
This commit is contained in:
+32
-31
@@ -938,7 +938,8 @@ class MessageInputState extends State<MessageInput> {
|
||||
super.initState();
|
||||
|
||||
if (!kIsWeb) {
|
||||
_keyboardListener = KeyboardVisibility.onChange.listen((visible) {
|
||||
_keyboardListener =
|
||||
KeyboardVisibilityController().onChange.listen((visible) {
|
||||
if (visible) {
|
||||
_onChange();
|
||||
} else {
|
||||
@@ -962,42 +963,42 @@ class MessageInputState extends State<MessageInput> {
|
||||
|
||||
Timer _debounce;
|
||||
void _onChange() {
|
||||
final s = textEditingController.text;
|
||||
StreamChannel.of(context).channel.keyStroke(
|
||||
widget.parentMessage?.id,
|
||||
);
|
||||
if (_debounce?.isActive == true) _debounce.cancel();
|
||||
_debounce = Timer(
|
||||
const Duration(milliseconds: 350),
|
||||
() {
|
||||
final s = textEditingController.text;
|
||||
StreamChannel.of(context).channel.keyStroke(
|
||||
widget.parentMessage?.id,
|
||||
);
|
||||
|
||||
setState(() {
|
||||
_messageIsPresent = s.trim().isNotEmpty;
|
||||
});
|
||||
setState(() {
|
||||
_messageIsPresent = s.trim().isNotEmpty;
|
||||
});
|
||||
|
||||
_commandsOverlay?.remove();
|
||||
_commandsOverlay = null;
|
||||
_mentionsOverlay?.remove();
|
||||
_mentionsOverlay = null;
|
||||
_commandsOverlay?.remove();
|
||||
_commandsOverlay = null;
|
||||
_mentionsOverlay?.remove();
|
||||
_mentionsOverlay = null;
|
||||
|
||||
if (s.trim().startsWith('/')) {
|
||||
_commandsOverlay = _buildCommandsOverlayEntry();
|
||||
Overlay.of(context).insert(_commandsOverlay);
|
||||
}
|
||||
if (s.trim().startsWith('/')) {
|
||||
_commandsOverlay = _buildCommandsOverlayEntry();
|
||||
Overlay.of(context).insert(_commandsOverlay);
|
||||
}
|
||||
|
||||
if (_messageIsPresent &&
|
||||
textEditingController.selection.isCollapsed &&
|
||||
textEditingController.selection.baseOffset > 0 &&
|
||||
textEditingController.text
|
||||
.substring(0, textEditingController.selection.baseOffset)
|
||||
.split(' ')
|
||||
.last
|
||||
.contains('@')) {
|
||||
if (_debounce?.isActive == true) _debounce.cancel();
|
||||
_debounce = Timer(
|
||||
const Duration(milliseconds: 500),
|
||||
() {
|
||||
if (_messageIsPresent &&
|
||||
textEditingController.selection.isCollapsed &&
|
||||
textEditingController.selection.baseOffset > 0 &&
|
||||
textEditingController.text
|
||||
.substring(0, textEditingController.selection.baseOffset)
|
||||
.split(' ')
|
||||
.last
|
||||
.contains('@')) {
|
||||
_mentionsOverlay = _buildMentionsOverlayEntry();
|
||||
Overlay.of(context).insert(_mentionsOverlay);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _parseExistingMessage(Message message) {
|
||||
|
||||
Reference in New Issue
Block a user