quotePlainText method Null safety

String quotePlainText(
  1. String header,
  2. String? text
)

Quotes the given plain text header and text.

Implementation

static String quotePlainText(final String header, final String? text) {
  if (text == null) {
    return '>\r\n';
  }
  return '>' +
      header.split('\r\n').join('\r\n>') +
      '\r\n>' +
      text.split('\r\n').join('\r\n>');
}