From 9399e28869ccf8b29e76db2bc05c69ac9038c089 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Mon, 9 Nov 2020 18:11:45 +0530 Subject: [PATCH] feat, fix: Added animation, fixed modal issues --- lib/src/message_input.dart | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 38ae6eb6..70444ce9 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -663,8 +663,9 @@ class MessageInputState extends State { _filePickerSize -= update.delta.dy; if (_filePickerSize < 100) { _filePickerSize = 100.0; - } else if (_filePickerSize > 500) { - _filePickerSize = 500; + } else if (_filePickerSize > + MediaQuery.of(context).size.height / 1.7) { + _filePickerSize = MediaQuery.of(context).size.height / 1.7; } }); }, @@ -732,21 +733,28 @@ class MessageInputState extends State { : BoxFit.fitHeight, ), ), - if (_attachments.any((element) => - element.id == _mediaData.item1[position].id)) - Container( - color: Colors.black.withOpacity(0.5), - child: Center( - child: CircleAvatar( - maxRadius: 12.0, - backgroundColor: Colors.white, - child: Icon( - StreamIcons.check, - color: Colors.black, + IgnorePointer( + child: AnimatedOpacity( + duration: Duration(milliseconds: 300), + opacity: _attachments.any((element) => + element.id == _mediaData.item1[position].id) + ? 1.0 + : 0.0, + child: Container( + color: Colors.black.withOpacity(0.5), + child: Center( + child: CircleAvatar( + maxRadius: 12.0, + backgroundColor: Colors.white, + child: Icon( + StreamIcons.check, + color: Colors.black, + ), ), ), ), ), + ), ], ), onTap: () { @@ -829,7 +837,8 @@ class MessageInputState extends State { void _getAllMedia() async { var allAlbums = await PhotoGallery.listAlbums(mediumType: MediumType.image); - var allVideoAlbums = await PhotoGallery.listAlbums(mediumType: MediumType.video); + var allVideoAlbums = + await PhotoGallery.listAlbums(mediumType: MediumType.video); List resultList = []; List> resultThumbnailList = [];