update dependencies

This commit is contained in:
Salvatore Giordano
2020-04-20 09:43:54 +02:00
parent 7c2d607a3a
commit b20ba2e306
7 changed files with 57 additions and 37 deletions
+14 -14
View File
@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:io';
import 'package:file_picker/file_picker.dart';
@@ -765,7 +766,7 @@ class _MessageInputState extends State<MessageInput> {
});
}
int _keyboardListener;
StreamSubscription _keyboardListener;
@override
void initState() {
@@ -773,16 +774,8 @@ class _MessageInputState extends State<MessageInput> {
StreamChannel.of(context).queryMembersAndWatchers();
_keyboardListener = KeyboardVisibilityNotification().addNewListener(
onHide: () {
if (_commandsOverlay != null) {
_commandsOverlay.remove();
}
if (_mentionsOverlay != null) {
_mentionsOverlay.remove();
}
},
onShow: () {
_keyboardListener = KeyboardVisibility.onChange.listen((visible) {
if (visible) {
if (_commandsOverlay != null) {
if (_textController.text.startsWith('/')) {
WidgetsBinding.instance.addPostFrameCallback((_) {
@@ -800,8 +793,15 @@ class _MessageInputState extends State<MessageInput> {
});
}
}
},
);
} else {
if (_commandsOverlay != null) {
_commandsOverlay.remove();
}
if (_mentionsOverlay != null) {
_mentionsOverlay.remove();
}
}
});
if (widget.editMessage != null) {
_textController = TextEditingController(text: widget.editMessage.text);
@@ -842,7 +842,7 @@ class _MessageInputState extends State<MessageInput> {
void dispose() {
_commandsOverlay?.remove();
_mentionsOverlay?.remove();
KeyboardVisibilityNotification().removeListener(_keyboardListener);
_keyboardListener.cancel();
super.dispose();
}