readyToExecuteWSRequest static method Null safety

Future<void> readyToExecuteWSRequest()

Implementation

static Future<void> readyToExecuteWSRequest() async {
  final state = SendbirdSdk().getConnectionState();
  if (state == ConnectionState.open) {
    flushCompleters();
    return;
  }

  if (state == ConnectionState.closed) {
    throw ConnectionRequiredError();
  }

  final completer = Completer();
  _queue.add(completer);
  return completer.future;
}