from static method

MailboxState from(
  1. int state
)

Implementation

static MailboxState from(int state) {
  switch (state) {
    case Mailbox._stateEmpty:
      return MailboxState.empty;
    case Mailbox._stateFull:
      return MailboxState.full;
    case Mailbox._stateClosed:
      return MailboxState.closed;
  }
  throw StateError('Mailbox is in unknown State: $state');
}