InlinePart class

Represents an inline part of a request or response, specifically used for handling binary data that is transmitted inline, such as images, audio, or other media types. This class wraps the InlineData object, which contains the actual binary content along with its metadata (like MIME type and Base64-encoded data).

Parameters:

  • inlineData (optional InlineData): The inline data associated with this part, typically representing binary data (e.g., an image or file content).

Usage: InlinePart is used when the system needs to handle inline data in the form of binary content. It is often used in conjunction with the Part interface to represent different types of parts in a larger message (e.g., for multi-part data like in a chat or file upload).

Implemented types

Constructors

InlinePart.new(InlineData? inlineData)
InlinePart.fromJson(Map<String, dynamic> json)
Factory method to create an InlinePart instance from a JSON map. This is used to deserialize JSON responses containing inline part data.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
inlineData InlineData?
getter/setter pair
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, dynamic>
Converts the InlinePart instance into a JSON map. This is used for serializing the inline part data (including its inline data) to be sent in an API request or stored in a database.
override
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

jsonToList(List list) List<InlinePart>
Converts a list of JSON objects into a list of InlinePart instances. This is useful for parsing an array of inline parts from a JSON response.
override