AdaptiveFile.fromBytes constructor
AdaptiveFile.fromBytes(})
Creates an AdaptiveFile from raw in-memory bytes.
Implementation
factory AdaptiveFile.fromBytes(
Uint8List bytes, {
required String name,
String? mimeType,
int? width,
int? height,
int? size,
DateTime? lastModified,
}) {
final inferredMime = mimeType ?? _inferMimeType(name);
return AdaptiveFile(
path: null,
name: name,
bytes: bytes,
mimeType: inferredMime,
width: width,
height: height,
size: size ?? bytes.lengthInBytes,
lastModified: lastModified ?? DateTime.now(),
);
}