track method
Registers this subject with the DevTools runtime under name.
Returns a TrackedSubject preserving the original Subject subtype; call
TrackedSubject.asSubject to unwrap, or chain .enableInjection(...) to
allow the panel to push values into the subject. In release builds this
is a no-op. Throws ArgumentError if name is empty.
Optional historySize caps the number of past events the panel retains
for this subject.
Implementation
TrackedSubject<T, S> track(String name, {int? historySize}) {
final id = _registerForTracking<T>(this, name, historySize);
return TrackedSubject(this, id);
}