From 1ffb878b15aea169f536b264e562093c3ef20106 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Mon, 21 Jun 2021 09:54:27 +0200 Subject: [PATCH] fix animation --- .../stream_chat_flutter/lib/src/message_input.dart | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/message_input.dart b/packages/stream_chat_flutter/lib/src/message_input.dart index 4f61c9fa..962d237b 100644 --- a/packages/stream_chat_flutter/lib/src/message_input.dart +++ b/packages/stream_chat_flutter/lib/src/message_input.dart @@ -251,7 +251,6 @@ class MessageInputState extends State { late final FocusNode _focusNode; bool _inputEnabled = true; bool _messageIsPresent = false; - bool _animateContainer = true; bool _commandEnabled = false; OverlayEntry? _commandsOverlay, _mentionsOverlay, _emojiOverlay; late Iterable _emojiNames; @@ -939,10 +938,6 @@ class MessageInputState extends State { } Widget _buildFilePickerSection() { - if (!_openFilePickerSection) { - return const Offstage(); - } - final _attachmentContainsFile = _attachments.values.any((it) => it.type == 'file'); @@ -975,8 +970,7 @@ class MessageInputState extends State { } return AnimatedContainer( - duration: - _animateContainer ? const Duration(milliseconds: 300) : Duration.zero, + duration: const Duration(milliseconds: 300), height: _openFilePickerSection ? _filePickerSize : 0, child: Material( color: _streamChatTheme.colorTheme.whiteSmoke, @@ -1034,7 +1028,6 @@ class MessageInputState extends State { GestureDetector( onVerticalDragUpdate: (update) { setState(() { - _animateContainer = false; _filePickerSize = (_filePickerSize - update.delta.dy).clamp( _kMinMediaPickerSize, MediaQuery.of(context).size.height / 1.7, @@ -1672,7 +1665,6 @@ class MessageInputState extends State { onPressed: () async { if (_openFilePickerSection) { setState(() { - _animateContainer = false; _openFilePickerSection = false; _filePickerSize = _kMinMediaPickerSize; }); @@ -1718,7 +1710,6 @@ class MessageInputState extends State { if (_openFilePickerSection) { setState(() { - _animateContainer = true; _openFilePickerSection = false; _filePickerSize = _kMinMediaPickerSize; });