ImapClient constructor
ImapClient({})
Creates a new ImapClient instance.
Set the eventBus 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 connectionTimeout
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,
Duration? connectionTimeout,
bool Function(X509Certificate)? onBadCertificate,
}) : _eventBus = bus ?? EventBus(),
super(
isLogEnabled: isLogEnabled,
logName: logName,
connectionTimeout: connectionTimeout,
onBadCertificate: onBadCertificate,
) {
_imapResponseReader = ImapResponseReader(onServerResponse);
}