fix(ui): render overflow for image attachements

This commit is contained in:
Gordon Hayes
2021-09-16 14:05:27 +02:00
parent 2b0588c9d8
commit ec6c663289
@@ -1090,6 +1090,9 @@ class MessageInputState extends State<MessageInput> {
duration: const Duration(milliseconds: 300), duration: const Duration(milliseconds: 300),
curve: Curves.easeOut, curve: Curves.easeOut,
height: _openFilePickerSection ? _kMinMediaPickerSize : 0, height: _openFilePickerSection ? _kMinMediaPickerSize : 0,
child: SingleChildScrollView(
child: SizedBox(
height: _kMinMediaPickerSize,
child: Material( child: Material(
color: _streamChatTheme.colorTheme.inputBg, color: _streamChatTheme.colorTheme.inputBg,
child: Column( child: Column(
@@ -1101,7 +1104,8 @@ class MessageInputState extends State<MessageInput> {
icon: StreamSvgIcon.pictures( icon: StreamSvgIcon.pictures(
color: _getIconColor(0), color: _getIconColor(0),
), ),
onPressed: _attachmentContainsFile && _attachments.isNotEmpty onPressed:
_attachmentContainsFile && _attachments.isNotEmpty
? null ? null
: () { : () {
setState(() { setState(() {
@@ -1114,7 +1118,8 @@ class MessageInputState extends State<MessageInput> {
icon: StreamSvgIcon.files( icon: StreamSvgIcon.files(
color: _getIconColor(1), color: _getIconColor(1),
), ),
onPressed: !_attachmentContainsFile && _attachments.isNotEmpty onPressed:
!_attachmentContainsFile && _attachments.isNotEmpty
? null ? null
: () { : () {
pickFile(DefaultAttachmentTypes.file); pickFile(DefaultAttachmentTypes.file);
@@ -1125,10 +1130,12 @@ class MessageInputState extends State<MessageInput> {
color: _getIconColor(2), color: _getIconColor(2),
), ),
onPressed: attachmentLimitCrossed || onPressed: attachmentLimitCrossed ||
(_attachmentContainsFile && _attachments.isNotEmpty) (_attachmentContainsFile &&
_attachments.isNotEmpty)
? null ? null
: () { : () {
pickFile(DefaultAttachmentTypes.image, camera: true); pickFile(DefaultAttachmentTypes.image,
camera: true);
}, },
), ),
IconButton( IconButton(
@@ -1137,10 +1144,12 @@ class MessageInputState extends State<MessageInput> {
color: _getIconColor(3), color: _getIconColor(3),
), ),
onPressed: attachmentLimitCrossed || onPressed: attachmentLimitCrossed ||
(_attachmentContainsFile && _attachments.isNotEmpty) (_attachmentContainsFile &&
_attachments.isNotEmpty)
? null ? null
: () { : () {
pickFile(DefaultAttachmentTypes.video, camera: true); pickFile(DefaultAttachmentTypes.video,
camera: true);
}, },
), ),
], ],
@@ -1193,6 +1202,8 @@ class MessageInputState extends State<MessageInput> {
], ],
), ),
), ),
),
),
); );
} }