AsyncStateRecorder<T> class

Records all AsyncValue state changes from an ReactiveAsyncNotifier.

Example

final notifier = ReactiveAsyncNotifier<String>();
final recorder = AsyncStateRecorder(notifier);

await notifier.execute(() async => 'hello');

expect(recorder.states, [
  isA<AsyncLoading<String>>(),
  isA<AsyncData<String>>(),
]);
recorder.dispose();

Constructors

AsyncStateRecorder(ReactiveAsyncNotifier<T> notifier)
Creates a recorder that listens to notifier.

Properties

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

Methods

clear() → void
Clears recorded states.
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