start method

void start({
  1. required String serverUrl,
})

Implementation

void start({required String serverUrl}) {
  assert(serverUrl.startsWith('ws:') || serverUrl.startsWith('wss:'));
  if(serverUrl.contains('192.168.') && !serverUrl.contains(':')) {
    throw 'Please, inform the port on the serverUrl, default is 3000, example: ws://192.168.0.8:3000';
  }
  _serverUrl = serverUrl;
  _initialized = true;
  _connect();
}