PartBuilder class
Allows to configure a mime part
- Implementers
Constructors
- PartBuilder.new(MimePart mimePart, {String? text, TransferEncoding transferEncoding = TransferEncoding.automatic, CharacterSet? characterSet, ContentTypeHeader? contentType})
Properties
-
attachments
→ List<
AttachmentInfo> -
final
- characterSet ↔ CharacterSet?
-
getter/setter pair
- contentDisposition ↔ ContentDispositionHeader?
-
getter/setter pair
- contentType ↔ ContentTypeHeader?
-
getter/setter pair
- hasAttachments → bool
-
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?
-
getter/setter pair
- transferEncoding ↔ TransferEncoding
-
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
data
and optionalfilename
. -
addFile(
File file, MediaType mediaType, {ContentDispositionHeader? disposition}) → Future< PartBuilder> -
Adds the
file
part asyncronously. -
addHeader(
String name, String value, {HeaderEncoding encoding = HeaderEncoding.none}) → void -
Adds a header with the specified
name
andvalue
. -
addMailAddressHeader(
String name, List< MailAddress> addresses) → void -
Adds another header with the specified
name
with the given mailaddresses
as its value -
addMessagePart(
MimeMessage mimeMessage, {ContentDisposition disposition = ContentDisposition.attachment}) → PartBuilder -
Adds the message
mimeData
as amessage/rfc822
content with the givensubject
as its filename. -
addMultipartAlternative(
) → 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
andvalue
, replacing any previous header with the samename
. -
setMailAddressHeader(
String name, List< MailAddress> addresses) → void -
Adds the header with the specified
name
with the given mailaddresses
as its value -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited