connect method

void connect(
  1. {bool toWebSocket = true,
  2. bool toRestApi = true}
)

Connect to the WebSocket server and/or the REST API server

Implementation

void connect({bool toWebSocket = true, bool toRestApi = true}) {
  log.i('Connect to Bybit.');
  streamGroup = StreamGroup();
  if (toWebSocket) {
    websocket.connect();
    streamGroup.add(websocket.controller!.stream);
  }
  if (toRestApi) {
    rest.connect();
    streamGroup.add(rest.streamGroup!.stream);
  }
  stream = streamGroup.stream.asBroadcastStream();
}