track method
Registers this stream with the DevTools runtime under name.
Returns a TrackedStream wrapping the original stream; call
TrackedStream.asStream to unwrap. In release builds this is a no-op —
no subscription is taken and nothing is registered. Throws
ArgumentError if name is empty.
Optional historySize caps the number of past events the panel retains
for this stream.
Implementation
TrackedStream<T> track(String name, {int? historySize}) {
_registerForTracking<T>(this, name, historySize);
return TrackedStream(this);
}