TimerSignal class
Emit recurring TimerSignalEvent aka AsyncSignal
- Inheritance
Constructors
- TimerSignal({required Duration every, String debugLabel = 'Timer', bool? cancelOnError, bool autoDispose = false})
- Emit recurring TimerSignalEvent aka AsyncSignal
Properties
- autoDispose ↔ bool
-
Throws and error if read after dispose and can be
disposed on last unsubscribe.
getter/setter pairinherited
- cancelOnError ↔ bool?
-
Cancel the subscription on error
latefinalinherited
- debugLabel → String?
-
Debug label for Debug Mode
finalinherited
-
dependencies
↔ List<
ReadonlySignal> -
List of dependencies to recompute the stream
latefinalinherited
- disposed ↔ bool
-
Check if the effect is disposed
getter/setter pairinherited
-
equalityCheck
↔ bool Function(AsyncState<
TimerSignalEvent> a, AsyncState<TimerSignalEvent> b) -
Optional method to check if to values are the same
getter/setter pairinherited
- every → Duration
-
Trigger an TimerSignalEvent every duration
final
-
first
→ Future<
TimerSignalEvent> -
Last value of the stream
no setterinherited
-
future
→ Future<
TimerSignalEvent> -
The future of the signal completer
no setterinherited
- globalId → int
-
Global ID of the signal
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
internalValue
→ AsyncState<
TimerSignalEvent> -
no setterinherited
- isCompleted → bool
-
Returns true if the signal is completed an error or data
no setterinherited
- isDone → bool
-
Check if the signal is done
no setterinherited
- isInitialized → bool
-
Check if a signal value is set (does not subscribe)
no setterinherited
- isPaused → bool
-
Check if the subscription is paused
no setterinherited
-
last
→ Future<
TimerSignalEvent> -
First value of the stream
no setterinherited
- requireValue → TimerSignalEvent
-
Returns the value of the signal
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
↔ AsyncState<
TimerSignalEvent> -
Compute the current value
getter/setter pairinherited
- version ↔ int
-
Version numbers should always be >= 0, because the special value -1 is used
by Nodes to signify potentially unused but recyclable nodes.
getter/setter pairinherited
Methods
-
add(
TimerSignalEvent event) → void -
Adds a data
event
to the sink.inherited -
addError(
Object error, [StackTrace? stackTrace]) → void -
Adds an
error
to the sink.inherited -
afterCreate(
AsyncState< TimerSignalEvent> val) → void -
Internal hook for after a signal is created
inherited
-
beforeUpdate(
AsyncState< TimerSignalEvent> val) → void -
Internal hook for after a signal is updated
inherited
-
call(
) → AsyncState< TimerSignalEvent> -
Return the value when invoked
inherited
-
cancel(
) → Future< void> -
Cancel the subscription
inherited
-
close(
) → void -
Closes the sink.
inherited
-
dispose(
) → void -
Dispose the signal
inherited
-
execute(
Stream< TimerSignalEvent> src) → Future<void> -
Execute the stream
inherited
-
get(
) → AsyncState< TimerSignalEvent> -
Helper method to get the current value
inherited
-
init(
) → void -
Initialize the signal
inherited
-
internalRefresh(
) → bool -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
void cleanup()) → void Function() -
Add a cleanup function to be called when the signal is disposed
inherited
-
overrideWith(
AsyncState< TimerSignalEvent> val) → Signal<AsyncState< TimerSignalEvent> > -
Override the current signal with a new value as if it was created with it
inherited
-
pause(
[Future< void> ? resume]) → void -
Pause the subscription
inherited
-
peek(
) → AsyncState< TimerSignalEvent> -
In the rare instance that you have an effect that should write to another signal based on the previous value, but you don't want the effect to be subscribed to that signal, you can read a signals's previous value via
signal.peek()
.inherited -
readonly(
) → ReadonlySignal< AsyncState< TimerSignalEvent> > -
Returns a readonly signal
inherited
-
refresh(
) → Future< void> -
Refresh the future
inherited
-
reload(
) → Future< void> -
Reload the future
inherited
-
reset(
[AsyncState< TimerSignalEvent> ? value]) → void -
Reset the signal to the initial value
inherited
-
resume(
) → void -
Resume the subscription
inherited
-
set(
AsyncState< TimerSignalEvent> val, {bool force = false}) → bool -
Set the current value by a method
inherited
-
setError(
Object error, [StackTrace? stackTrace]) → void -
Set the error with optional stackTrace to AsyncError
inherited
-
setLoading(
[AsyncState< TimerSignalEvent> ? state]) → void -
Set the loading state to AsyncLoading
inherited
-
setValue(
TimerSignalEvent value) → void -
Set the value to AsyncData
inherited
-
subscribe(
void fn(AsyncState< TimerSignalEvent> value)) → void Function() -
Subscribe to value changes with a dispose function
inherited
-
subscribeToNode(
Node node) → void -
inherited
-
toJson(
) → dynamic -
Convert value to JSON
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribeFromNode(
Node node) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited