copyWith method
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,
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,
);
}