getMailbox method
Retrieves the mailbox with the specified flag
from the provided boxes
. When no boxes are given, then the MailClient.mailboxes
are used.
Implementation
Mailbox? getMailbox(MailboxFlag flag, [List<Mailbox>? boxes]) {
boxes ??= mailboxes;
return boxes?.firstWhereOrNull((box) => box.hasFlag(flag));
}