copyWith method

ChatConfig copyWith({
  1. String? apiUrl,
  2. bool? enableTypingIndicators,
  3. bool? enableReadReceipts,
  4. bool? enableOnlineStatus,
  5. bool? autoMarkAsRead,
  6. int? connectionTimeout,
  7. int? maxReconnectionAttempts,
  8. int? chatRoomRefreshInterval,
  9. String? userId,
  10. String? token,
  11. Map<String, String>? additionalHeaders,
  12. Map<String, dynamic>? socketParams,
  13. bool? debugMode,
  14. Future<String> fileUploadHandler(
    1. String filePath
    )?,
})

Create a copy of this config with some values changed

Implementation

ChatConfig copyWith({
  String? apiUrl,
  bool? enableTypingIndicators,
  bool? enableReadReceipts,
  bool? enableOnlineStatus,
  bool? autoMarkAsRead,
  int? connectionTimeout,
  int? maxReconnectionAttempts,
  int? chatRoomRefreshInterval,
  String? userId,
  String? token,
  Map<String, String>? additionalHeaders,
  Map<String, dynamic>? socketParams,
  bool? debugMode,
  Future<String> Function(String filePath)? fileUploadHandler,
}) {
  return ChatConfig(
    apiUrl: apiUrl ?? this.apiUrl,
    enableTypingIndicators:
        enableTypingIndicators ?? this.enableTypingIndicators,
    enableReadReceipts: enableReadReceipts ?? this.enableReadReceipts,
    enableOnlineStatus: enableOnlineStatus ?? this.enableOnlineStatus,
    autoMarkAsRead: autoMarkAsRead ?? this.autoMarkAsRead,
    connectionTimeout: connectionTimeout ?? this.connectionTimeout,
    maxReconnectionAttempts:
        maxReconnectionAttempts ?? this.maxReconnectionAttempts,
    chatRoomRefreshInterval:
        chatRoomRefreshInterval ?? this.chatRoomRefreshInterval,
    userId: userId ?? this.userId,
    token: token ?? this.token,
    additionalHeaders: additionalHeaders ?? this.additionalHeaders,
    socketParams: socketParams ?? this.socketParams,
    debugMode: debugMode ?? this.debugMode,
    fileUploadHandler: fileUploadHandler ?? this.fileUploadHandler,
  );
}