TextMimeData constructor

TextMimeData(
  1. String text, {
  2. required bool containsHeader,
})

Creates a new text based mime data

with the specified text and the containsHeader information.

Line endings are automatically normalized to CRLF (\r\n) for RFC 5322 compliance, tolerating bare LF from non-conformant MIME generators (e.g. Node.js mimetext on Linux which uses os.EOL).

Implementation

TextMimeData(String text, {required bool containsHeader})
    : text = _normalizeLineEndings(text),
      super(containsHeader: containsHeader) {
  _size = this.text.length;
}