init static method

void init({
  1. bool botEnabled = false,
  2. bool syncTokenEnabled = false,
  3. bool fetchGroupUserProfiles = false,
  4. int preloadInboxMetadataCount = 10,
  5. int maxCachedManagers = 10,
  6. Duration pausedDurationWhenAppBackground = const Duration(minutes: 2),
  7. required Future<bool> connection,
  8. required Stream<bool> connectivity,
  9. required ChatAiDelegate ai,
  10. required ChatCacheDelegate cache,
  11. required ChatRoomDelegate room,
  12. required ChatMessageDelegate message,
  13. required ChatStatusDelegate status,
  14. required ChatTypingDelegate typing,
  15. required ChatProfileDelegate profile,
  16. required ChatNotificationDelegate notification,
  17. required ChatUserSettingsDelegate settings,
  18. required ChatFieldValueNormalizer normalizer,
  19. ChatModelConfigs modelConfigs = const ChatModelConfigs(),
  20. ChatErrorReporter errorReporter = const DefaultChatErrorReporter(),
})

Implementation

static void init({
  bool botEnabled = false,
  bool syncTokenEnabled = false,
  bool fetchGroupUserProfiles = false,
  int preloadInboxMetadataCount = 10,
  int maxCachedManagers = 10,
  Duration pausedDurationWhenAppBackground = const Duration(minutes: 2),
  required Future<bool> connection,
  required Stream<bool> connectivity,
  required ChatAiDelegate ai,
  required ChatCacheDelegate cache,
  required ChatRoomDelegate room,
  required ChatMessageDelegate message,
  required ChatStatusDelegate status,
  required ChatTypingDelegate typing,
  required ChatProfileDelegate profile,
  required ChatNotificationDelegate notification,
  required ChatUserSettingsDelegate settings,
  required ChatFieldValueNormalizer normalizer,
  ChatModelConfigs modelConfigs = const ChatModelConfigs(),
  ChatErrorReporter errorReporter = const DefaultChatErrorReporter(),
}) {
  _instance?.dispose();
  _instance = RoomManager._(
    botEnabled: botEnabled,
    syncTokenEnabled: syncTokenEnabled,
    pausedDurationWhenAppBackground: pausedDurationWhenAppBackground,
    connection: connection,
    connectivity: connectivity,
    fetchGroupUserProfiles: fetchGroupUserProfiles,
    preloadInboxMetadataCount: preloadInboxMetadataCount,
    maxCachedManagers: maxCachedManagers,
    modelConfigs: modelConfigs,
    ai: ai,
    cache: cache,
    room: room,
    message: message,
    status: status,
    typing: typing,
    profile: profile,
    notification: notification,
    settings: settings,
    normalizer: normalizer,
    errorReporter: errorReporter,
  );
}