AttachedFile.fromFile constructor
AttachedFile.fromFile(})
Creates an AttachedFile from a local file.
Example:
final file = File('assets/image.png');
final attachedFile = AttachedFile.fromFile(file, 'image.png', spoiler: false);
Implementation
factory AttachedFile.fromFile(
File file,
String name, {
bool? spoiler,
String? proxyUrl,
int? height,
int? width,
String? contentType,
String? description,
}) {
final mediaItem = MediaItem.fromFile(
file,
name,
spoiler: spoiler,
proxyUrl: proxyUrl,
height: height,
width: width,
contentType: contentType,
description: description,
);
return AttachedFile._(mediaItem);
}