forked from eatvio/eatvio_app
feat(feed): comments + redesign blogPost
This commit is contained in:
@@ -163,14 +163,37 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
SizedBox(width: 8),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles();
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||
allowMultiple: true,
|
||||
type: FileType.custom,
|
||||
allowedExtensions: [
|
||||
'pdf',
|
||||
'doc',
|
||||
'docx',
|
||||
'json',
|
||||
'ppt',
|
||||
'pptx',
|
||||
'rtf',
|
||||
'txt',
|
||||
'xls',
|
||||
'xlsx',
|
||||
'csv',
|
||||
'jpeg',
|
||||
'jpg',
|
||||
'png',
|
||||
'gif',
|
||||
'svg',
|
||||
'xml',
|
||||
'webp',
|
||||
],
|
||||
);
|
||||
|
||||
if (result != null) {
|
||||
File file = File(result.files.single.path!);
|
||||
List<File> files = result.paths.map((path) => File(path!)).toList();
|
||||
context.read<ChatRoomCubit>().sendMessage(
|
||||
chatId: widget.chatId,
|
||||
files: [file],
|
||||
);
|
||||
chatId: widget.chatId,
|
||||
files: files,
|
||||
);
|
||||
} else {
|
||||
// User canceled the picker
|
||||
}
|
||||
@@ -239,9 +262,9 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
onTap: () {
|
||||
if (textEditingController.text.isNotEmpty) {
|
||||
context.read<ChatRoomCubit>().sendMessage(
|
||||
chatId: widget.chatId,
|
||||
data: textEditingController.text.trim(),
|
||||
);
|
||||
chatId: widget.chatId,
|
||||
data: textEditingController.text.trim(),
|
||||
);
|
||||
setState(() {
|
||||
textEditingController.clear();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user