feat: Added remove image
This commit is contained in:
@@ -22,7 +22,7 @@ typedef FileUploader = Future<String> Function(PlatformFile, Channel);
|
||||
typedef AttachmentThumbnailBuilder = Widget Function(
|
||||
BuildContext,
|
||||
_SendingAttachment,
|
||||
);
|
||||
);
|
||||
|
||||
enum ActionsLocation {
|
||||
left,
|
||||
@@ -668,8 +668,7 @@ class MessageInputState extends State<MessageInput> {
|
||||
),
|
||||
),
|
||||
if (_attachments.any((element) =>
|
||||
element.id ==
|
||||
mediaData.data.item1[position].id))
|
||||
element.id == mediaData.data.item1[position].id))
|
||||
Container(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
child: Center(
|
||||
@@ -683,7 +682,14 @@ class MessageInputState extends State<MessageInput> {
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
if (!_attachments.any((element) =>
|
||||
element.id == mediaData.data.item1[position].id)) {
|
||||
_addAttachment(mediaData.data.item1[position]);
|
||||
} else {
|
||||
_attachments.removeWhere((element) =>
|
||||
element.id == mediaData.data.item1[position].id);
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user