Adds a subscription to this stream that processes the event during the capture phase.
In contrast, the listen method processes the event during the target or bubbling phase.
On each data event from this stream, the subscriber's onData
handler
is called.
The priority
level of the event listener can be specified. The higher
the number, the higher the priority. All listeners with priority n are
processed before listeners of priority n-1. If two or more listeners share
the same priority, they are processed in the order in which they were
added. The default priority is 0.
Source
EventStreamSubscription<T> capture(void onData(T event), { int priority: 0 }) { return _subscribe(onData, true, priority); }