toMultipartFile method
Returns the file as MultiPartFile for use with tha http package. Useful for file upload in apps.
Implementation
http.MultipartFile toMultipartFile({String? filename}) {
filename ??= fileName;
return http.MultipartFile.fromBytes(
'file',
_bytes,
contentType: MediaType('application', 'octet-stream'),
filename: filename,
);
}