Probe class Null safety

A Probe is responsible for collecting data.

A probe's state can be set using the initialize, resume, pause, and stop methods. A restart can be used to restart a probe when its measure has changed (e.g. disabling the probe). A probe can be stopped at any time. If an error occurs the state of a probe becomes undefined. This is, for example, used when an exception is caught or when a probe is not available (e.g. on iOS).

The state property reveals the probe's current runtime state. The stateEvents is a stream of state changes which can be listen to as a broadcast stream.

Probes return sensed data in a Stream as data. This is the main usage of a probe. For example, to listens to events and print them;;




data Stream<DataPoint>
The stream of DataPoint generated from this probe.
enabled bool
Is this probe enabled, i.e. available for collection of data using the resume method.
hashCode int
The hash code for this object. [...]
read-only, inherited
measure Measure?
The Measure that configures this probe.
name String
A printer-friendly name for this probe.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
state ProbeState
The runtime state of this probe.
stateEvents Stream<ProbeState>
The runtime state changes of this probe. [...]
type String
The type of this probe according to String.


initialize(Measure measure) → void
Initialize the probe before starting it. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
pause() → void
Pause the probe. The probe is paused until resume or restart is called.
restart() → void
Restart the probe. [...]
resume() → void
Resume the probe.
stop() → void
Stop the probe. Once a probe is stopped, it cannot be started again. If you need to restart a probe, use the restart or pause and resume methods.
toString() String
A string representation of this object. [...]
validNextState(ProbeState nextState) bool
Is ProbeState a valid next state for this probe? [...]


operator ==(Object other) bool
The equality operator. [...]