Track a stream
.track() is also available on plain Dart Streams — useful for derived streams (the output of Rx.combineLatest, .map, .where, .switchMap, etc.) and for streams coming from sources you don’t own, like Firestore snapshots, WebSocket events, or platform channels. The panel shows the latest value and the event log, the same way as for a tracked Subject — just read-only.
Quick example
Wrap the stream at the point you build the derived pipeline:
import 'package:rxdart/rxdart.dart';import 'package:rxdart_devtools/sdk.dart';
final sum = Rx.combineLatest2<int, int, int>(a, b, (x, y) => x + y) .shareValue() .track('combineLatest.sum') .asStream();sum is the original Stream<int> — .asStream() unwraps the TrackedStream<T> wrapper. The stream appears in the panel labelled combineLatest.sum, and every emission flows into the Current value card and the Event log.
Choosing a name
The string you pass to .track() is the row label in DevTools.
- Use a stable, identifier-style name:
cart.total,combineLatest.sum,userPresence. Hot reloads re-register under the same name, so the panel correlates events across the reload. - Keep it short — long names crowd the row layout.
- Namespace with
.when you have many derived streams:search.query,search.results,search.suggestions.
Related
- Track a subject — the richer version for Subjects, with optional panel-driven injection.
- Display complex values — how the panel renders the values your stream emits.