update dependencies

This commit is contained in:
Salvatore Giordano
2020-11-24 16:17:53 +01:00
parent 897ef85050
commit 0c875ab68e
2 changed files with 34 additions and 33 deletions
+32 -31
View File
@@ -938,7 +938,8 @@ class MessageInputState extends State<MessageInput> {
super.initState(); super.initState();
if (!kIsWeb) { if (!kIsWeb) {
_keyboardListener = KeyboardVisibility.onChange.listen((visible) { _keyboardListener =
KeyboardVisibilityController().onChange.listen((visible) {
if (visible) { if (visible) {
_onChange(); _onChange();
} else { } else {
@@ -962,42 +963,42 @@ class MessageInputState extends State<MessageInput> {
Timer _debounce; Timer _debounce;
void _onChange() { void _onChange() {
final s = textEditingController.text; if (_debounce?.isActive == true) _debounce.cancel();
StreamChannel.of(context).channel.keyStroke( _debounce = Timer(
widget.parentMessage?.id, const Duration(milliseconds: 350),
); () {
final s = textEditingController.text;
StreamChannel.of(context).channel.keyStroke(
widget.parentMessage?.id,
);
setState(() { setState(() {
_messageIsPresent = s.trim().isNotEmpty; _messageIsPresent = s.trim().isNotEmpty;
}); });
_commandsOverlay?.remove(); _commandsOverlay?.remove();
_commandsOverlay = null; _commandsOverlay = null;
_mentionsOverlay?.remove(); _mentionsOverlay?.remove();
_mentionsOverlay = null; _mentionsOverlay = null;
if (s.trim().startsWith('/')) { if (s.trim().startsWith('/')) {
_commandsOverlay = _buildCommandsOverlayEntry(); _commandsOverlay = _buildCommandsOverlayEntry();
Overlay.of(context).insert(_commandsOverlay); Overlay.of(context).insert(_commandsOverlay);
} }
if (_messageIsPresent && if (_messageIsPresent &&
textEditingController.selection.isCollapsed && textEditingController.selection.isCollapsed &&
textEditingController.selection.baseOffset > 0 && textEditingController.selection.baseOffset > 0 &&
textEditingController.text textEditingController.text
.substring(0, textEditingController.selection.baseOffset) .substring(0, textEditingController.selection.baseOffset)
.split(' ') .split(' ')
.last .last
.contains('@')) { .contains('@')) {
if (_debounce?.isActive == true) _debounce.cancel();
_debounce = Timer(
const Duration(milliseconds: 500),
() {
_mentionsOverlay = _buildMentionsOverlayEntry(); _mentionsOverlay = _buildMentionsOverlayEntry();
Overlay.of(context).insert(_mentionsOverlay); Overlay.of(context).insert(_mentionsOverlay);
}, }
); },
} );
} }
void _parseExistingMessage(Message message) { void _parseExistingMessage(Message message) {
+2 -2
View File
@@ -19,10 +19,10 @@ dependencies:
flutter_markdown: ^0.5.0 flutter_markdown: ^0.5.0
url_launcher: ^5.4.11 url_launcher: ^5.4.11
video_player: ^1.0.0 video_player: ^1.0.0
chewie: ^0.10.4 chewie: ^0.12.0
file_picker: ^2.0.12 file_picker: ^2.0.12
image_picker: ^0.6.7+2 image_picker: ^0.6.7+2
flutter_keyboard_visibility: ^3.3.0 flutter_keyboard_visibility: ^4.0.1
stream_chat: ^0.2.13 stream_chat: ^0.2.13
mime: ^0.9.6+3 mime: ^0.9.6+3
visibility_detector: ^0.1.5 visibility_detector: ^0.1.5