setServerAddress method

void setServerAddress(
  1. {required String address}
)

Manual search action.

Implementation

void setServerAddress({
  required String address,
}) {
  _channel = WebSocketChannel.connect(
    Uri.parse(address),
  )..stream.asBroadcastStream().listen((message) {
      _controller.add(null);
      messages.add(message);
    }, onError: (_) {
      clearServerAddress();
      mediaType.refreshTab();
    });
}