Implementation
factory FileMessage.fromParams({
required FileMessageParams params,
required BaseChannel channel,
}) {
final msg = FileMessage(
requestId: Uuid().v1(),
url: params.uploadFile.url ?? '',
messageId: 0,
name: params.uploadFile.name,
localFile: params.uploadFile.file,
size: params.uploadFile.fileSize ?? 0,
channelType: channel.channelType,
channelUrl: channel.channelUrl,
mentionType: params.mentionType,
createdAt: DateTime.now().millisecondsSinceEpoch,
requireAuth: false,
replyToChannel: params.replyToChannel,
);
return msg;
}