onceDiagnostic method

void onceDiagnostic({
  1. required DiagnosticHandler handler,
})
inherited

Implementation

void onceDiagnostic({required handler}) {
  // ignore: cancel_subscriptions
  var subscription = onDiagnostic(handler: handler);
  subscription.onData((data) {
    if (data.containsKey(HostEventType.diagnostic))
      offDiagnostic(handler: handler);
  });
}