connect method

FutureOr<WebSocketChannel> connect({
  1. required Uri uri,
  2. Iterable<String>? protocols,
  3. Map<String, dynamic>? headers,
})

Function to define another connection without call directly the connection function

Implementation

FutureOr<WebSocketChannel> connect(
    {required Uri uri,
    Iterable<String>? protocols,
    Map<String, dynamic>? headers}) {
  if (connectFn != null) {
    return connectFn!(uri, protocols);
  }
  return defaultConnectPlatform(
    uri,
    protocols,
    headers: headers ?? this.headers,
  );
}