From 408ef863b4f1f46c34c697aa51d00f84fa4d692d Mon Sep 17 00:00:00 2001 From: rlee1990 Date: Fri, 29 Apr 2022 23:24:15 -0400 Subject: [PATCH] Update attachment_file_uploader.dart Added the option to add a Map of extra data that someone might need. --- .../lib/src/core/api/attachment_file_uploader.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/stream_chat/lib/src/core/api/attachment_file_uploader.dart b/packages/stream_chat/lib/src/core/api/attachment_file_uploader.dart index d6dc249f..00c0a13b 100644 --- a/packages/stream_chat/lib/src/core/api/attachment_file_uploader.dart +++ b/packages/stream_chat/lib/src/core/api/attachment_file_uploader.dart @@ -16,6 +16,7 @@ abstract class AttachmentFileUploader { String channelType, { ProgressCallback? onSendProgress, CancelToken? cancelToken, + Map? extraData, }); /// Uploads a [file] to the given channel. @@ -29,6 +30,7 @@ abstract class AttachmentFileUploader { String channelType, { ProgressCallback? onSendProgress, CancelToken? cancelToken, + Map? extraData, }); /// Deletes a image using its [url] from the given channel. @@ -40,6 +42,7 @@ abstract class AttachmentFileUploader { String channelId, String channelType, { CancelToken? cancelToken, + Map? extraData, }); /// Deletes a file using its [url] from the given channel. @@ -51,6 +54,7 @@ abstract class AttachmentFileUploader { String channelId, String channelType, { CancelToken? cancelToken, + Map? extraData, }); } @@ -68,6 +72,7 @@ class StreamAttachmentFileUploader implements AttachmentFileUploader { String channelType, { ProgressCallback? onSendProgress, CancelToken? cancelToken, + Map? extraData, }) async { final multiPartFile = await file.toMultipartFile(); final response = await _client.postFile( @@ -86,6 +91,7 @@ class StreamAttachmentFileUploader implements AttachmentFileUploader { String channelType, { ProgressCallback? onSendProgress, CancelToken? cancelToken, + Map? extraData, }) async { final multiPartFile = await file.toMultipartFile(); final response = await _client.postFile( @@ -103,6 +109,7 @@ class StreamAttachmentFileUploader implements AttachmentFileUploader { String channelId, String channelType, { CancelToken? cancelToken, + Map? extraData, }) async { final response = await _client.delete( '/channels/$channelType/$channelId/image', @@ -118,6 +125,7 @@ class StreamAttachmentFileUploader implements AttachmentFileUploader { String channelId, String channelType, { CancelToken? cancelToken, + Map? extraData, }) async { final response = await _client.delete( '/channels/$channelType/$channelId/file',