ReactiveValueRecorder<T> class

Records all value changes emitted by a ReactiveNotifier.

Useful in tests to assert that a notifier emitted the expected sequence of values.

Example

final counter = ReactiveNotifier<int>(0);
final recorder = ReactiveValueRecorder(counter);

counter.value = 1;
counter.value = 2;
counter.value = 3;

expect(recorder.values, [1, 2, 3]);
recorder.dispose();

Constructors

ReactiveValueRecorder(ReactiveNotifier<T> notifier)
Creates a recorder that listens to notifier.

Properties

count int
The number of recorded values.
no setter
hashCode int
The hash code for this object.
no setterinherited
last → T?
The last recorded value, or null if none recorded.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values List<T>
All recorded values in order.
final

Methods

clear() → void
Clears recorded values.
dispose() → void
Stops recording and removes the listener.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited