WebSocketChannel.connect constructor Null safety

  1. Uri uri,
  2. {Iterable<String>? protocols}

Creates a new WebSocket connection.

Connects to uri using and returns a channel that can be used to communicate over the resulting socket.

The optional protocols parameter is the same as WebSocket.connect.


factory WebSocketChannel.connect(Uri uri, {Iterable<String>? protocols}) =>
    platform.connect(uri, protocols: protocols);