copyWith method

WebSocketConfig copyWith({
  1. String? url,
  2. Duration? connectionTimeout,
  3. bool? enableReconnection,
  4. int? maxReconnectionAttempts,
  5. Duration? initialReconnectionDelay,
  6. Duration? maxReconnectionDelay,
  7. double? backoffMultiplier,
  8. bool? enableMessageQueue,
  9. int? maxQueueSize,
  10. Duration? heartbeatInterval,
  11. bool? enableHeartbeat,
  12. Map<String, String>? headers,
  13. List<String>? protocols,
  14. bool? enableCompression,
})

Returns a copy of this config with updated values.

Implementation

WebSocketConfig copyWith({
  String? url,
  Duration? connectionTimeout,
  bool? enableReconnection,
  int? maxReconnectionAttempts,
  Duration? initialReconnectionDelay,
  Duration? maxReconnectionDelay,
  double? backoffMultiplier,
  bool? enableMessageQueue,
  int? maxQueueSize,
  Duration? heartbeatInterval,
  bool? enableHeartbeat,
  Map<String, String>? headers,
  List<String>? protocols,
  bool? enableCompression,
}) {
  return WebSocketConfig(
    url: url ?? this.url,
    connectionTimeout: connectionTimeout ?? this.connectionTimeout,
    enableReconnection: enableReconnection ?? this.enableReconnection,
    maxReconnectionAttempts:
        maxReconnectionAttempts ?? this.maxReconnectionAttempts,
    initialReconnectionDelay:
        initialReconnectionDelay ?? this.initialReconnectionDelay,
    maxReconnectionDelay: maxReconnectionDelay ?? this.maxReconnectionDelay,
    backoffMultiplier: backoffMultiplier ?? this.backoffMultiplier,
    enableMessageQueue: enableMessageQueue ?? this.enableMessageQueue,
    maxQueueSize: maxQueueSize ?? this.maxQueueSize,
    heartbeatInterval: heartbeatInterval ?? this.heartbeatInterval,
    enableHeartbeat: enableHeartbeat ?? this.enableHeartbeat,
    headers: headers ?? this.headers,
    protocols: protocols ?? this.protocols,
    enableCompression: enableCompression ?? this.enableCompression,
  );
}