ImapClient constructor

ImapClient({
  1. EventBus? bus,
  2. bool isLogEnabled = false,
  3. String? logName,
  4. Duration? defaultWriteTimeout,
  5. Duration? defaultResponseTimeout,
  6. bool onBadCertificate(
    1. X509Certificate
    )?,
})

Creates a new ImapClient instance.

Set the bus to add your specific EventBus to listen to IMAP events.

Set isLogEnabled to true for getting log outputs on the standard output.

Optionally specify a logName that is given out at logs to differentiate between different imap clients.

Set the defaultWriteTimeout in case the connection connection should timeout automatically after the given time.

onBadCertificate is an optional handler for unverifiable certificates. The handler receives the X509Certificate, and can inspect it and decide (or let the user decide) whether to accept the connection or not. The handler should return true to continue the SecureSocket connection.

Implementation

ImapClient({
  EventBus? bus,
  bool isLogEnabled = false,
  String? logName,
  this.defaultWriteTimeout,
  this.defaultResponseTimeout,
  bool Function(X509Certificate)? onBadCertificate,
})  : _eventBus = bus ?? EventBus(),
      super(
        isLogEnabled: isLogEnabled,
        logName: logName,
        onBadCertificate: onBadCertificate,
      ) {
  _imapResponseReader = ImapResponseReader(onServerResponse);
}