onDiagnostic method

  1. @override
StreamSubscription<Map<HostEventType, dynamic>> onDiagnostic({
  1. required DiagnosticHandler handler,
})
inherited

Implementation

@override
StreamSubscription<Map<HostEventType, dynamic>> onDiagnostic({
  required DiagnosticHandler handler,
}) {
  final subsription = h.eventStream.listen((data) {
    if (data.containsKey(HostEventType.diagnostic)) {
      handler(message: data.values.first);
    }
  });
  h.diagntosticListenerHandlers
      .update(handler, (value) => subsription, ifAbsent: () => subsription);
  return subsription;
}