DataPart class final

A data part containing binary data (e.g., images).

Inheritance
Available extensions
Annotations

Constructors

DataPart(Uint8List bytes, {required String mimeType, String? name})
Creates a new data part.
DataPart.fromJson(Map<String, Object?> json)
Creates a data part from a JSON-compatible map.
factory

Properties

asUiInteractionPart UiInteractionPart?

Available on StandardPart, provided by the UiPartExtension extension

Returns this part as a UiInteractionPart view.
no setter
asUiPart UiPart?

Available on StandardPart, provided by the UiPartExtension extension

Returns this part as a UiPart view, if generic type checks out.
no setter
bytes Uint8List
The binary data.
final
hashCode int
The hash code for this object.
no setteroverride
isUiInteractionPart bool

Available on StandardPart, provided by the UiPartExtension extension

Whether this part is a UI interaction part.
no setter
isUiPart bool

Available on StandardPart, provided by the UiPartExtension extension

Whether this part is a UI part.
no setter
mimeType String
The MIME type of the data.
final
name String?
Optional name for the data.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
Serializes the part to a JSON map.
override
toString() String
A string representation of this object.
override

Operators

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

Static Methods

extensionFromMimeType(String mimeType) String?
Gets the extension for a MIME type.
fromFile(XFile file) Future<DataPart>
Creates a data part from an XFile.
mimeTypeForFile(String path, {Uint8List? headerBytes}) String
Gets the MIME type for a file.
nameFromMimeType(String mimeType) String
Gets the name for a MIME type.

Constants

defaultMimeType → const String
type → const String