HttpFile class Null safety

A file to be uploaded as part of a IsolateHttp.

Constructors

HttpFile.fromBytes(String field, List<int> bytes, {String? filename, MediaType? contentType})
Creates a new HttpFile from a byte array.
factory
HttpFile.fromPath(String field, String filePath, {String? filename, MediaType? contentType})
Creates a new HttpFile from a path to a file on disk.
factory
HttpFile.fromString(String field, String value, {String? filename, MediaType? contentType})
Creates a new HttpFile from a string.
factory

Properties

bytes List<int>?
Byte array of the file.
final
contentType → MediaType?
The content-type of the file.
final
field String
The name of the form field for the file.
final
filename String?
The basename of the file.
final
filePath String?
The path to a file on disk.
final
hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
value String?
The encoding to use when translating value into bytes is taken from contentType if it has a charset set. Otherwise, it defaults to UTF-8. contentType currently defaults to text/plain; charset=utf-8, but in the future may be inferred from filename.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toMultipartFile() Future<MultipartFile?>
Convert HttpFile to MultipartFile.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited