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