Mailbox.setup constructor

Mailbox.setup(
  1. String name,
  2. String path,
  3. List<MailboxFlag> flags, {
  4. String? pathSeparator,
})

Creates a new mailbox with the specified name, path and flags.

Optionally specify the path separator with pathSeparator

Implementation

Mailbox.setup(String name, String path, this.flags, {String? pathSeparator}) {
  this.name = name;
  this.path = path;
  if (pathSeparator != null) {
    this.pathSeparator = pathSeparator;
  }
  if (name.toUpperCase() == 'INBOX' && !isInbox) {
    flags.add(MailboxFlag.inbox);
  }
  isMarked = hasFlag(MailboxFlag.marked);
  hasChildren = hasFlag(MailboxFlag.hasChildren);
  isSelected = hasFlag(MailboxFlag.select);
  isUnselectable = hasFlag(MailboxFlag.noSelect);
}