listMailboxes method Null safety

Future<List<Mailbox>> listMailboxes(
  1. {List<MailboxFlag>? order}
)

Lists all mailboxes/folders of the incoming mail server.

Optionally specify the order of the mailboxes, matching ones will be served in the given order.

Implementation

Future<List<Mailbox>> listMailboxes({List<MailboxFlag>? order}) async {
  var boxes = await _incomingMailClient.listMailboxes();
  _mailboxes = boxes;
  if (order != null) {
    boxes = sortMailboxes(order, boxes);
  }
  return boxes;
}