feat(feed): comments + redesign blogPost

This commit is contained in:
mso7nueh
2024-08-19 16:15:18 +03:00
parent 23c28df73d
commit 026a11a6ca
16 changed files with 2528 additions and 295 deletions

View File

@@ -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();
});