StreamProvider<T> class
A provider that listens to a Stream and exposes its latest value.
Set describeState
to customize the description of the state.
See BaseNotifier.describeState
.
Set debugLabel to customize the debug label of the provider.
Constructors
-
StreamProvider(Stream<
T> _builder(WatchableRef ref), {ProviderChangedCallback<AsyncValue< ? onChanged, String describeState(AsyncValue<T> >T> state)?, String? debugLabel, bool debugVisibleInGraph = true})
Properties
- customDebugLabel → String?
-
A custom label used by debug tools.
finalinherited
- debugLabel → String
-
A label to be used in debug messages and
by the RefenaTracingPage.
no setter
- debugVisibleInGraph → bool
-
Set this flag to false to hide the provider from the RefenaGraphPage.
By default, all providers are visible in the graph.
However, some providers add unnecessary noise.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
provider
→ BaseProvider<
StreamProviderNotifier< T> , AsyncValue<T> > -
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createState(
ProxyRef ref) → StreamProviderNotifier< T> -
getActualProvider(
BaseNotifier< Object?> notifier) → StreamProvider<T> -
inherited
-
getSelectedState(
StreamProviderNotifier< T> notifier, AsyncValue<T> state) → AsyncValue<T> -
The default behavior to return the whole state when
using
ref.watch(provider)
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overrideWithStream(
Stream< T> builder(Ref ref)) → ProviderOverride<StreamProviderNotifier< T> , AsyncValue<T> > - Overrides the stream.
-
select<
R> (R selector(AsyncValue< T> state)) → SelectedWatchable<StreamProviderNotifier< T> , AsyncValue<T> , R> -
Used for ref.watch(provider.select(...)).
Select a part of the state.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
Subclasses should not override this method.
It is used internally by RefenaContainer to map a provider to a state.
inherited
Static Methods
-
family<
T, P> (StreamFamilyBuilder< T, P> stream, {String describeState(AsyncValue<T> state)?, String? debugLabel, bool debugVisibleInGraph = true}) → StreamFamilyProvider<T, P> - A shorthand for StreamFamilyProvider.