MimePart class Null safety

A MIME part In a simple case a MIME message only has one MIME part.

Implementers

Constructors

MimePart()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
headers List<Header>?
The headers field contains all message(part) headers
read / write
mediaType MediaType
Simplified way to retrieve the media type When no content-type header is defined, the media type text/plain is returned
read-only
mimeData MimeData?
The raw message data of this part. May or may not include headers, depending on retrieval.
read / write
parts List<MimePart>?
The children of this part, if any.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addHeader(String name, String? value, [HeaderEncoding encoding = HeaderEncoding.none]) → void
Adds a header with the specified name, value and optional encoding.
addPart(MimePart part) → void
collectContentInfo(ContentDisposition disposition, List<ContentInfo> result, String? fetchId, {bool? reverse, bool? complete}) → void
Adds the matching disposition header with the specified disposition of this part and this children parts to the result. [...]
decodeContentBinary() Uint8List?
Decodes the binary data of this part.
decodeContentMessage() MimeMessage?
Decodes a message/rfc822 part
decodeContentText() String?
Decodes the text of this part.
decodeDate() DateTime?
Decodes the message 'date' header to local time.
decodeFileName() String?
Tries to find and decode the associated file name
decodeHeaderDateValue(String name) DateTime?
Decodes the a date value of the first matching header
decodeHeaderMailAddressValue(String name) List<MailAddress>?
Decodes the email address value of first matching header
decodeHeaderValue(String name) String?
Decodes the value of the first matching header
decodeTextHtmlPart() String?
Tries to find a 'content-type: text/html' part and decodes its contents when found.
decodeTextPlainPart() String?
Tries to find a 'content-type: text/plain' part and decodes its contents when found.
getHeader(String name) Iterable<Header>?
Retrieves all matching headers with the specified name.
getHeaderContentDisposition() ContentDispositionHeader?
Retrieves the first 'content-disposition' header.
getHeaderContentType() ContentTypeHeader?
Retrieves the first 'content-type' header.
getHeaderValue(String name) String?
Retrieves the raw value of the first matching header. [...]
getPartWithMediaSubtype(MediaSubtype subtype) MimePart?
Searches the MimePart with the specified subtype.
hasHeader(String name) bool
Checks if this MIME part has a header with the specified name.
hasPart(MediaSubtype subtype, {int? depth}) bool
Checks if this MIME part or a child is of the specified media type [...]
hasTextPart({int? depth}) bool
Checks if this MIME part or a child is textual. [...]
insertPart(MimePart part) → void
isTextMediaType() bool
Checks if this MIME part is textual.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
parse() → void
Parses this and all children MIME parts.
removeHeader(String name) → void
Removes the header with the specified name.
render(StringBuffer buffer, {bool renderHeader = true}) → void
Renders this mime part with all children parts into the specified buffer. [...]
setHeader(String name, String? value, [HeaderEncoding encoding = HeaderEncoding.none]) → void
Sets a header with the specified name, value and optional encoding, replacing any existing header with the same name.
toString() String
A string representation of this object. [...]
inherited

Operators

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