ImageFile constructor
ImageFile({})
Implementation
ImageFile({
required this.filePath,
required this.rawBytes,
String? contentType,
int? width,
int? height,
}) : _contentType = contentType,
_width = width,
_height = height {
if (width == null && height == null) {
ImageSizeData? imageSizeData;
try {
imageSizeData = ImageSizeData.fromBytes(rawBytes);
} catch (_) {}
_width = imageSizeData?.width;
_height = imageSizeData?.height;
}
if (contentType == null) {
_contentType = mime.lookupMimeType(
filePath,
headerBytes: List.from(rawBytes),
);
}
}