[LLC, UI-KIT] Add support for custom attachment upload delegate

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-02-05 14:57:17 +05:30
parent f18d2c37bf
commit 628542f99b
12 changed files with 418 additions and 243 deletions
+10 -2
View File
@@ -223,19 +223,27 @@ class Channel {
}
/// Send a file to this channel
Future<SendFileResponse> sendFile(MultipartFile file) async {
Future<SendFileResponse> sendFile(
MultipartFile file, {
ProgressCallback onSendProgress,
}) async {
final response = await _client.post(
'$_channelURL/file',
data: FormData.fromMap({'file': file}),
onSendProgress: onSendProgress,
);
return _client.decode(response.data, SendFileResponse.fromJson);
}
/// Send an image to this channel
Future<SendImageResponse> sendImage(MultipartFile file) async {
Future<SendImageResponse> sendImage(
MultipartFile file, {
ProgressCallback onSendProgress,
}) async {
final response = await _client.post(
'$_channelURL/image',
data: FormData.fromMap({'file': file}),
onSendProgress: onSendProgress,
);
return _client.decode(response.data, SendImageResponse.fromJson);
}