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),
curve: Curves.easeOut,
height: _openFilePickerSection ? _kMinMediaPickerSize : 0,
child: SingleChildScrollView(
child: SizedBox(
height: _kMinMediaPickerSize,
child: Material(
color: _streamChatTheme.colorTheme.inputBg,
child: Column(
@@ -1101,7 +1104,8 @@ class MessageInputState extends State<MessageInput> {
icon: StreamSvgIcon.pictures(
color: _getIconColor(0),
),
onPressed: _attachmentContainsFile && _attachments.isNotEmpty
onPressed:
_attachmentContainsFile && _attachments.isNotEmpty
? null
: () {
setState(() {
@@ -1114,7 +1118,8 @@ class MessageInputState extends State<MessageInput> {
icon: StreamSvgIcon.files(
color: _getIconColor(1),
),
onPressed: !_attachmentContainsFile && _attachments.isNotEmpty
onPressed:
!_attachmentContainsFile && _attachments.isNotEmpty
? null
: () {
pickFile(DefaultAttachmentTypes.file);
@@ -1125,10 +1130,12 @@ class MessageInputState extends State<MessageInput> {
color: _getIconColor(2),
),
onPressed: attachmentLimitCrossed ||
(_attachmentContainsFile && _attachments.isNotEmpty)
(_attachmentContainsFile &&
_attachments.isNotEmpty)
? null
: () {
pickFile(DefaultAttachmentTypes.image, camera: true);
pickFile(DefaultAttachmentTypes.image,
camera: true);
},
),
IconButton(
@@ -1137,10 +1144,12 @@ class MessageInputState extends State<MessageInput> {
color: _getIconColor(3),
),
onPressed: attachmentLimitCrossed ||
(_attachmentContainsFile && _attachments.isNotEmpty)
(_attachmentContainsFile &&
_attachments.isNotEmpty)
? null
: () {
pickFile(DefaultAttachmentTypes.video, camera: true);
pickFile(DefaultAttachmentTypes.video,
camera: true);
},
),
],
@@ -1193,6 +1202,8 @@ class MessageInputState extends State<MessageInput> {
],
),
),
),
),
);
}