create static method
FileContent
create(
- String msgType, {
- TransportableData? data,
- String? filename,
- Uri? url,
- DecryptKey? password,
Implementation
static FileContent create(String msgType, {
TransportableData? data, String? filename,
Uri? url, DecryptKey? password,
}) {
if (msgType == ContentType.IMAGE) {
return ImageFileContent.from(data, filename, url, password);
} else if (msgType == ContentType.AUDIO) {
return AudioFileContent.from(data, filename, url, password);
} else if (msgType == ContentType.VIDEO) {
return VideoFileContent.from(data, filename, url, password);
}
return BaseFileContent.from(msgType, data, filename, url, password);
}