Seprate uploading action in chat

This commit is contained in:
2025-09-24 16:53:32 +08:00
parent 612f1bf004
commit 02ec11845b
2 changed files with 420 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ class ChatInput extends HookConsumerWidget {
final Function(int) onDeleteAttachment;
final Function(int, int) onMoveAttachment;
final Function(List<UniversalFile>) onAttachmentsChanged;
final Map<String, Map<int, double>> attachmentProgress;
const ChatInput({
super.key,
@@ -48,6 +49,7 @@ class ChatInput extends HookConsumerWidget {
required this.onDeleteAttachment,
required this.onMoveAttachment,
required this.onAttachmentsChanged,
required this.attachmentProgress,
});
@override
@@ -123,6 +125,7 @@ class ChatInput extends HookConsumerWidget {
width: 280,
child: AttachmentPreview(
item: attachments[idx],
progress: attachmentProgress['chat-upload']?[idx],
onRequestUpload: () => onUploadAttachment(idx),
onDelete: () => onDeleteAttachment(idx),
onUpdate: (value) {