PartBuilder class

Allows to configure a mime part

Implementers

Constructors

PartBuilder(MimePart mimePart, {String? text, TransferEncoding transferEncoding = TransferEncoding.automatic, CharacterSet? characterSet, ContentTypeHeader? contentType})
Creates a new part builder

Properties

attachments List<AttachmentInfo>
The attachments in this builder
no setter
characterSet CharacterSet?
The char set like ASCII or UTF-8 used in the text
getter/setter pair
contentDisposition ContentDispositionHeader?
The way that this part should be handled, e.g. inline or as attachment.
getter/setter pair
contentType ContentTypeHeader?
The media type represented by this part
getter/setter pair
hasAttachments bool
Checks if there is at least 1 attachment
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String?
the text in this part builder
getter/setter pair
transferEncoding TransferEncoding
The scheme used for encoding 8bit characters in the text
getter/setter pair

Methods

addBinary(Uint8List data, MediaType mediaType, {TransferEncoding transferEncoding = TransferEncoding.base64, ContentDispositionHeader? disposition, String? filename}) PartBuilder
Adds a binary data part with the given mediaType.
addFile(File file, MediaType mediaType, {ContentDispositionHeader? disposition}) Future<PartBuilder>
Adds the file part asynchronously.
addHeader(String name, String value, {HeaderEncoding encoding = HeaderEncoding.none}) → void
Adds a header with the specified name and value.
addMailAddressHeader(String name, List<MailAddress> addresses) → void
Adds another header with the specified name
addMessagePart(MimeMessage mimeMessage, {ContentDisposition disposition = ContentDisposition.attachment}) PartBuilder
Adds the message mimeMessage as a message/rfc822 content.
addMultipartAlternative({String? plainText, String? htmlText}) PartBuilder
Adds a part with the multipart/alternative subtype.
addPart({ContentDispositionHeader? disposition, MimePart? mimePart, MediaSubtype? mediaSubtype, bool insert = false}) PartBuilder
Adds a new part
addText(String text, {MediaType? mediaType, TransferEncoding transferEncoding = TransferEncoding.automatic, CharacterSet characterSet = CharacterSet.utf8, ContentDispositionHeader? disposition, bool insert = false}) PartBuilder
Adds a text part to this message with the specified text.
addTextHtml(String text, {TransferEncoding transferEncoding = TransferEncoding.automatic, CharacterSet characterSet = CharacterSet.utf8, ContentDispositionHeader? disposition, bool insert = false}) PartBuilder
Adds a HTML text part
addTextPlain(String text, {TransferEncoding transferEncoding = TransferEncoding.automatic, CharacterSet characterSet = CharacterSet.utf8, ContentDispositionHeader? disposition, bool insert = false}) PartBuilder
Adds a plain text part
getPart(MediaSubtype mediaSubtype, {bool recursive = true}) PartBuilder?
Retrieves the first builder with the specified mediaSubtype.
getTextHtmlPart() PartBuilder?
Retrieves the first builder with a text/plain part.
getTextPlainPart() PartBuilder?
Retrieves the first builder with a text/plain part.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAttachment(AttachmentInfo info) → void
Removes the specified attachment info
removeHeader(String name) → void
Removes the header with the specified name.
removePart(PartBuilder childBuilder) → void
Removes the specified part childBuilder
setContentType(MediaType mediaType, {CharacterSet? characterSet, String? multiPartBoundary, String? name, Map<String, String>? parameters}) → void
Creates the content-type based on the specified mediaType.
setHeader(String name, String? value, {HeaderEncoding encoding = HeaderEncoding.none}) → void
Sets a header with the specified name and value
setMailAddressHeader(String name, List<MailAddress> addresses) → void
Adds the header with the specified name
toString() String
A string representation of this object.
inherited

Operators

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