MailCodec class Null safety

Encodes and decodes base-64 and quoted printable encoded texts Compare https://tools.ietf.org/html/rfc2045#page-19 and https://tools.ietf.org/html/rfc2045#page-23 for details

Implementers

Constructors

MailCodec()
const

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

decodeData(String part) Uint8List
decodeText(String part, Encoding codec, {bool isHeader = false}) String
encodeHeader(String text, {bool fromStart = false}) String
Encodes the header text in the chosen codec's only if required. text specifies the text to be encoded. codec the optional codec, which defaults to utf8. Set the optional fromStart to true in case the encoding should start at the beginning of the text and not in the middle.
encodeText(String text, {Codec codec = encodingUtf8, bool wrap = true}) String
Encodes the specified text in the chosen codec's format. text specifies the text to be encoded. codec the optional codec, which defaults to utf8. Set wrap to false in case you do not want to wrap lines.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Methods

decode8BitTextData(String part) Uint8List
decodeAnyText(String text, String? transferEncoding, String? charset) String
decodeAsText(Uint8List data, String? transferEncoding, String? charset) String
decodeBinary(String text, String? transferEncoding) Uint8List
decodeBinaryTextData(String part) Uint8List
decodeHeader(String? input) String?
decodeOnlyCodec(String part, Encoding codec, {bool isHeader = false}) String
detectHeaderEncoding(String value) HeaderEncoding
wrapText(String text, {bool wrapAtWordBoundary = false}) String
Wraps the text so that it stays within email's 76 characters per line convention. text the text that should be wrapped. Set wrapAtWordBoundary to true in case the text should be wrapped at word boundaries / spaces.

Constants

base64 → const Base64MailCodec
contentTransferEncodingNone → const String
'none'
encodingAscii → const AsciiCodec
AsciiCodec(allowInvalid: true)
encodingLatin1 → const Latin1Codec
Latin1Codec(allowInvalid: true)
encodingUtf8 → const Utf8Codec
Utf8Codec(allowMalformed: true)
quotedPrintable → const QuotedPrintableMailCodec