selectExtensionEvents method

Stream<VMExtensionEvent> selectExtensionEvents (
  1. String kind,
  2. {bool prefix: false}
)

Returns a broadcast stream that emits custom events posted via postEvent from the dart:developer package.

Unlike onExtensionEvent, this only emits events for which VMExtensionEvent.kind is kind. If prefix is true, it also emits events for which VMExtensionEvent.kind starts with kind.

This is supported as of VM service version 3.1, or Dart SDK version 1.14.

Implementation

Stream<VMExtensionEvent> selectExtensionEvents(String kind,
    {bool prefix: false}) {
  return transform(_onExtensionEvent, (event, sink) {
    if (prefix == null ? event.kind == kind : event.kind.startsWith(kind)) {
      sink.add(event);
    }
  });
}