ChannelFileMessageSendApiRequest constructor
Null safety
Implementation
ChannelFileMessageSendApiRequest({
required this.channelType,
required String channelUrl,
required FileMessageParams params,
String? senderId,
List<dynamic>? thumbnails,
bool markAsRead = false,
bool? requireAuth,
List<String>? additionalMentionedUserIds,
}) : super() {
url = '${channelType.urlString}/$channelUrl/messages';
body = {
'message_type': CommandString.fileMessage,
'user_id': senderId ?? state.userId,
'mark_as_read': markAsRead,
'require_auth': requireAuth,
'mentioned_user_ids': additionalMentionedUserIds,
'thumbnails': thumbnails,
'file_size': params.uploadFile.fileSize,
'file_name': params.uploadFile.name,
'file_type': params.uploadFile.mimeType,
'url': params.uploadFile.url,
};
body.addAll(params.toJson());
body.removeWhere((key, value) => value == null);
}