StreamChatPersistenceClient constructor

StreamChatPersistenceClient({
  1. ConnectionMode connectionMode = ConnectionMode.regular,
  2. Level logLevel = Level.WARNING,
  3. bool webUseExperimentalIndexedDb = false,
  4. LogHandlerFunction? logHandlerFunction,
})

Creates a new instance of the stream chat persistence client

Implementation

StreamChatPersistenceClient({
  /// Connection mode on which the client will work
  ConnectionMode connectionMode = ConnectionMode.regular,
  Level logLevel = Level.WARNING,

  /// Whether to use an experimental storage implementation on the web
  /// that uses IndexedDB if the current browser supports it.
  /// Otherwise, falls back to the local storage based implementation.
  bool webUseExperimentalIndexedDb = false,
  LogHandlerFunction? logHandlerFunction,
})  : _connectionMode = connectionMode,
      _webUseIndexedDbIfSupported = webUseExperimentalIndexedDb,
      _logger = Logger.detached('💽')..level = logLevel {
  _logger.onRecord.listen(logHandlerFunction ?? _defaultLogHandler);
}