From a5bb7072b346db8f6b3d8d38bdf8b7f9b79828ff Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 23 Jun 2020 13:03:23 +0200 Subject: [PATCH] update deprecated dependency --- lib/src/message_input.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 9926aa8e..6358e39e 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -161,6 +161,7 @@ class MessageInputState extends State { final _focusNode = FocusNode(); final List _mentionedUsers = []; + final _imagePicker = ImagePicker(); bool _inputEnabled = true; bool _messageIsPresent = false; bool _typingStarted = false; @@ -721,11 +722,13 @@ class MessageInputState extends State { } if (camera) { + PickedFile pickedFile; if (fileType == DefaultAttachmentTypes.image) { - file = await ImagePicker.pickImage(source: ImageSource.camera); + pickedFile = await _imagePicker.getImage(source: ImageSource.camera); } else if (fileType == DefaultAttachmentTypes.video) { - file = await ImagePicker.pickVideo(source: ImageSource.camera); + pickedFile = await _imagePicker.getVideo(source: ImageSource.camera); } + file = File(pickedFile.path); } else { FileType type; if (fileType == DefaultAttachmentTypes.image) {