NativeFile constructor
Implementation
NativeFile({
required this.name,
required this.size,
this.path,
Uint8List? bytes,
Stream<List<int>>? stream,
this.mime,
Size? dimensions,
}) : bytes = Rx(bytes),
dimensions = Rx(dimensions),
_readStream = stream {
if (mime == null) {
if (path != null) {
var type = lookupMimeType(path!);
if (type != null) {
mime = MediaType.parse(type);
}
} else if (bytes != null) {
var type = lookupMimeType(name, headerBytes: bytes);
if (type != null) {
mime = MediaType.parse(type);
}
}
}
if (bytes != null) {
_determineDimension();
}
}