appendMessageToFlag method Null safety

Future<UidResponseCode?> appendMessageToFlag(
  1. MimeMessage message,
  2. MailboxFlag targetMailboxFlag,
  3. {List<String>? flags}
)

Appends the message to the mailbox with the targetMailboxFlag.

Optionally specify the message flags.

Implementation

Future<UidResponseCode?> appendMessageToFlag(
    MimeMessage message, MailboxFlag targetMailboxFlag,
    {List<String>? flags}) {
  final mailbox = getMailbox(targetMailboxFlag);
  if (mailbox == null) {
    throw MailException(
        this, 'No mailbox with flag $targetMailboxFlag found in $mailboxes.');
  }
  return appendMessage(message, mailbox, flags: flags);
}