StreamValuable<Output, Msg> class
A Valuable that remains on a Stream
This object provide a valuer function, for each possible state of the Stream
- dataValue while the Stream messaging without error
- errorValue when the Stream get an error
- doneValue when the Stream closes and is done
- Inheritance
-
- Object
- ChangeNotifier
- Valuable<
Output> - StreamValuable
- Available Extensions
Constructors
-
StreamValuable(Valuable<
Stream< stream, {required ValuableGetStreamData<Msg> >Output, Msg> dataValue, required ValuableGetStreamError<Output> errorValue, required ValuableGetStreamDone<Output> doneValue, required Output initialData, bool evaluateWithContext = false}) - Constructor to provide each functions
-
StreamValuable.values(Valuable<
Stream< stream, {required Output errorValue, required Output doneValue, required Output initialData, bool evaluateWithContext = false})Msg> > -
Constructor to simplify the case when
Output
==Msg
Properties
-
dataValue
→ ValuableGetStreamData<
Output, Msg> -
A function to provide an
Output
value on aMsg
messagefinal -
doneValue
→ ValuableGetStreamDone<
Output> -
A function to provide an
Output
value when the Stream closesfinal -
errorValue
→ ValuableGetStreamError<
Output> -
A function to provide an
Output
value on an error in the Streamfinal - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isMounted → bool
-
Returns if this object is still mounted
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- valuableContext → ValuableContext?
-
no setterinherited
- valueCache → _ValueCache
-
finalinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
cleanWatched(
) → void -
inherited
-
dispose(
) → void -
Should be called to clean all links to other Valuables, and all the rest
override
-
equals(
dynamic other) → Valuable< bool> -
Compare with a value that type is
Output
or another Valuableinherited -
getValue(
[ValuableContext? context = const ValuableContext()]) → Output -
Get the current value of the Valuable
inherited
-
getValueDefinition(
bool reevaluatingNeeded, [ValuableContext? context = const ValuableContext()]) → Output -
This method should be redefined in ever sub-classes to determine how works
the method getValue
override
-
historize(
) → HistorizedValuable< Output> -
Build an HistorizedValuable based on this Valuable
inherited
-
listenDispose(
VoidCallback onDispose) → void -
Allows to be notified when this Valuable is disposed
inherited
-
map<
Other> (Other toElement(Output)) → Valuable< Other> -
A method to map a Valuable from
Output
toOther
inherited -
markToReevaluate(
) → void -
Mark the valuable to be reevaluated
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notEquals(
dynamic other) → Valuable< bool> -
Compare with a value that type is
Output
or another Valuableinherited -
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onValuableChange(
) → void -
Called when a Valuable notify a change.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unwatch(
Valuable valuable) → void -
Remove listener on the valuable, that may change scope, or that about to be disposed
Internal purpose
inherited
-
watch<
T> (Valuable< T> valuable, {ValuableContext? valuableContext, ValuableWatcherSelector<T> ? selector}) → T -
Watch a valuable, that eventually change
inherited
Operators
-
operator <(
dynamic other) → Valuable< bool> -
Compare with a value that type is
Output
or another Valuableinherited -
operator <=(
dynamic other) → Valuable< bool> -
Compare with a value that type is
Output
or another Valuableinherited -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
dynamic other) → Valuable< bool> -
Compare with a value that type is
Output
or another Valuableinherited -
operator >=(
dynamic other) → Valuable< bool> -
Compare with a value that type is
Output
or another Valuableinherited
Static Methods
-
asyncVal<
Msg> (Valuable< Stream< stream) → StreamValuable<Msg> >ValuableAsyncValue< Msg> , Msg> -
Pseudo constructor to map directly a
Msg
value to anAsyncValue<Msg>