addIncomingServer method Null safety

void addIncomingServer(
  1. ServerConfig server
)

Implementation

void addIncomingServer(ServerConfig server) {
  incomingServers ??= <ServerConfig>[];
  incomingServers!.add(server);
  preferredIncomingServer ??= server;
  if (server.type == ServerType.imap && preferredIncomingImapServer == null) {
    preferredIncomingImapServer = server;
  }
  if (server.type == ServerType.pop && preferredIncomingPopServer == null) {
    preferredIncomingPopServer = server;
  }
}