copyWith method

WebSocketConfig copyWith({
  1. String? url,
  2. List<String>? protocols,
  3. Map<String, String>? headers,
  4. Duration? pingInterval,
  5. Duration? connectionTimeout,
  6. Duration? reconnectDelay,
  7. int? maxReconnectAttempts,
  8. bool? autoReconnect,
  9. bool? enableLogging,
  10. bool? enableHeartbeat,
  11. Duration? heartbeatInterval,
  12. Duration? heartbeatTimeout,
  13. String? heartbeatMessage,
  14. String? expectedPongMessage,
  15. int? maxMissedHeartbeats,
  16. bool? useExponentialBackoff,
  17. Duration? maxReconnectDelay,
  18. double? backoffMultiplier,
  19. HttpClient? httpClient,
})

Creates a copy of this config with updated values

Implementation

WebSocketConfig copyWith({
  String? url,
  List<String>? protocols,
  Map<String, String>? headers,
  Duration? pingInterval,
  Duration? connectionTimeout,
  Duration? reconnectDelay,
  int? maxReconnectAttempts,
  bool? autoReconnect,
  bool? enableLogging,
  bool? enableHeartbeat,
  Duration? heartbeatInterval,
  Duration? heartbeatTimeout,
  String? heartbeatMessage,
  String? expectedPongMessage,
  int? maxMissedHeartbeats,
  bool? useExponentialBackoff,
  Duration? maxReconnectDelay,
  double? backoffMultiplier,
  HttpClient? httpClient,
}) {
  return WebSocketConfig(
    url: url ?? this.url,
    protocols: protocols ?? this.protocols,
    headers: headers ?? this.headers,
    pingInterval: pingInterval ?? this.pingInterval,
    connectionTimeout: connectionTimeout ?? this.connectionTimeout,
    reconnectDelay: reconnectDelay ?? this.reconnectDelay,
    maxReconnectAttempts: maxReconnectAttempts ?? this.maxReconnectAttempts,
    autoReconnect: autoReconnect ?? this.autoReconnect,
    enableLogging: enableLogging ?? this.enableLogging,
    enableHeartbeat: enableHeartbeat ?? this.enableHeartbeat,
    heartbeatInterval: heartbeatInterval ?? this.heartbeatInterval,
    heartbeatTimeout: heartbeatTimeout ?? this.heartbeatTimeout,
    heartbeatMessage: heartbeatMessage ?? this.heartbeatMessage,
    expectedPongMessage: expectedPongMessage ?? this.expectedPongMessage,
    maxMissedHeartbeats: maxMissedHeartbeats ?? this.maxMissedHeartbeats,
    useExponentialBackoff: useExponentialBackoff ?? this.useExponentialBackoff,
    maxReconnectDelay: maxReconnectDelay ?? this.maxReconnectDelay,
    backoffMultiplier: backoffMultiplier ?? this.backoffMultiplier,
    httpClient: httpClient ?? this.httpClient,
  );
}