feat: Added new picker implementation
This commit is contained in:
+31
-16
@@ -839,22 +839,37 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (snapshot.data) {
|
if (snapshot.data) {
|
||||||
return IgnorePointer(
|
if (_attachmentContainsFile) {
|
||||||
ignoring: _attachmentContainsFile,
|
return Container(
|
||||||
child: MediaListView(
|
color: Color(0xfff2f2f2),
|
||||||
selectedIds: _attachments.map((e) => e.id).toList(),
|
child: InkWell(
|
||||||
onSelect: (media) async {
|
onTap: () {
|
||||||
if (!_attachments
|
pickFile(DefaultAttachmentTypes.file);
|
||||||
.any((element) => element.id == media.id)) {
|
},
|
||||||
_addAttachment(media);
|
child: Text(
|
||||||
} else {
|
'Add more files',
|
||||||
setState(() {
|
style: TextStyle(
|
||||||
_attachments
|
color: StreamChatTheme.of(context).accentColor,
|
||||||
.removeWhere((element) => element.id == media.id);
|
fontWeight: FontWeight.bold,
|
||||||
});
|
),
|
||||||
}
|
),
|
||||||
},
|
),
|
||||||
),
|
alignment: Alignment.center,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return MediaListView(
|
||||||
|
selectedIds: _attachments.map((e) => e.id).toList(),
|
||||||
|
onSelect: (media) async {
|
||||||
|
if (!_attachments
|
||||||
|
.any((element) => element.id == media.id)) {
|
||||||
|
_addAttachment(media);
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
_attachments
|
||||||
|
.removeWhere((element) => element.id == media.id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user