Ref<Value> class
abstract
Passed to the Pod.read method, allowing you to interact with other pods and manage the lifecycle of your state.
Constructors
- Ref()
Properties
- container → PodContainer
-
Unsafely access the container.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
debounce(
Duration duration) → Future< void> -
debounce is a technique used to control the rate at which a
function is called. It ensures that a function is only executed after a
certain
duration
has passed since the last time it was called. -
dispose(
) → void - Dispose all disposers.
-
mount(
Pod pod) → void -
Subscribe to the given
pod
without listening for changes. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
void cb()) → void -
Register a
cb
function, that is called when the pod is invalidated or disposed. -
read<
T> (Pod< T> pod) → T -
Read the value for the given
pod
once. -
refresh(
RefreshablePod pod) → void -
Refresh the given
pod
. -
refreshSelf(
) → void - Refresh the current pod
-
self(
) → Value? - Get the value of the current pod.
-
set<
T, V> (WritablePod< T, V> pod, V value) → void -
Set the value for the given
pod
. -
setSelf(
Value value) → void - Set the value for the current pod.
-
stream<
T> (Pod< T> pod) → Stream<T> -
Subscribe to the given
pod
. -
subscribe<
T> (Pod< T> pod, void handler(T value), {bool fireImmediately = false}) → void -
Subscribe to the given
pod
, automatically cancelling the subscription when this pod is disposed. -
subscribeWithPrevious<
T> (Pod< T> pod, void handler(T? previous, T value), {bool fireImmediately = false}) → void -
Subscribe to the given
pod
, automatically cancelling the subscription when this pod is disposed. -
throttle(
void callback(), {Duration duration = const Duration(milliseconds: 500)}) → void -
throttle function to limit the rate at which a
callback
is called. Throttling is often used to control the frequency of function calls, especially when dealing with user input or events -
toString(
) → String -
A string representation of this object.
inherited
-
watch<
T> (Pod< T> pod) → T -
Watch the value for the given
pod
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited