onceConnection method

void onceConnection({
  1. required HostConnectionHandler handler,
})
inherited

Implementation

void onceConnection({required handler}) {
  // ignore: cancel_subscriptions
  var subscription = onConnection(handler: handler);
  subscription.onData((data) {
    if (data.containsKey(HostEventType.connection))
      offConnection(handler: handler);
  });
}