Is your feature request related to a problem? Please describe.
StreamNotifier.steam returns a broadcast stream that is idle until the state is set. It should instead notify the current state immediately.
Describe the solution you'd like
The stream getter should return a ValueStream constructed using BehaviorSubject.seeded or something similar. This variant of the stream always notifies with the last known value on listen, which is consistent with how the StateNotifier.addListener works.
Describe alternatives you've considered
This extension is consistent with addListener:
extension _StateEx<T> on StateNotifier<T> {
ValueStream<T> get valueStream {
// ignore: invalid_use_of_protected_member
return stream.shareValueSeeded(state);
}
}
This would be breaking and likely require an extra dependency or a lot of work. I have no plan to do such a thing.
So while I appreciate the request, I'll close this as it won't be worked on :)
Is your feature request related to a problem? Please describe.
StreamNotifier.steam returns a broadcast stream that is idle until the state is set. It should instead notify the current state immediately.
Describe the solution you'd like
The
stream
getter should return a ValueStream constructed using BehaviorSubject.seeded or something similar. This variant of the stream always notifies with the last known value on listen, which is consistent with how the StateNotifier.addListener works.Describe alternatives you've considered
This extension is consistent with
addListener
: