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