SharedPod<A extends Object, B extends Object> class base

Inheritance
Available extensions

Constructors

SharedPod.new(String key, {required A fromValue(B? rawValue), required B toValue(A value), required A initialValue})

Properties

fromValue → A Function(B? rawValue)
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
initialValue → A
final
isDisposed bool
Whether this Pod has been disposed of or not.
no setterinherited
key String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toValue → B Function(A value)
final
updateValue → A
Returns the current value of the Pod and calls refresh
no setterinherited
value ↔ A
The current value of the object. When the value changes, the callbacks registered with addListener will be invoked.
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
❌ Do not use this method directly. Use addStrongRefListener instead.
inherited
addSingleExecutionListener(VoidCallback listener) → void
Registers a listener that will be called only once when the object notifies its listeners. After the listener is called, it is automatically removed.
inherited
addStrongRefListener({required VoidCallback strongRefListener}) → void
Register a closure to be called when the object notifies its listeners.
inherited
asChildPod<TParent extends Object>() ChildPod<TParent, T>

Available on ValueListenable<T>, provided by the ValueListenableExt extension

Casts the ValueListenable to a ChildPod.
asDisposablePod() DisposablePod<T>

Available on ValueListenable<T>, provided by the ValueListenableExt extension

Casts the ValueListenable to a DisposablePod.
asGenericPod() GenericPod<T>

Available on ValueListenable<T>, provided by the ValueListenableExt extension

Casts the ValueListenable to a GenericPod.
asProtectedPod() ProtectedPod<T>

Available on ValueListenable<T>, provided by the ValueListenableExt extension

Casts the ValueListenable to a ProtectedPod.
asRootPod() RootPod<T>

Available on ValueListenable<T>, provided by the ValueListenableExt extension

Casts the ValueListenable to a RootPod.
asSharedPod<TRawValue extends Object>() SharedPod<T, TRawValue>

Available on ValueListenable<T>, provided by the ValueListenableExt extension

Casts the ValueListenable to a SharedPod.
asValueListenable() ValueListenable<T>

Available on ValueListenable<T>, provided by the ValueListenableExt extension

Returns the Pod as a ValueListenable.
cond(bool test(A value)) Resolvable<A>
Returns the value of the Pod when the test returns true.
inherited
delete({bool notifyImmediately = true}) Future<void>
dispose() → void
Disposes all children before disposing this.
inherited
disposeChildren() → void
Disposes and removes all children.
inherited
getValue() → A
inherited
map<B extends Object>(B reducer(A value)) ChildPod<A, B>
Maps this GenericPod to a new ChildPod using the specified reducer.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
reduce<C extends Object, O extends Object>(GenericPod<O> other, TReducerFn2<C, A, O> reducer) ChildPod<Object, C>
Reduces the current Pod and other into a single ChildPod.
inherited
refresh({bool notifyImmediately = true}) Future<void>
Triggers notifyListeners after a zero-duration delay.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
set(A newValue, {bool notifyImmediately = true}) Future<void>
Sets the value of the Pod to newValue and calls notifyListeners if the value is different from the current value.
override
toString() String
A string representation of this object.
inherited
update(A updateValue(A oldValue), {bool notifyImmediately = true}) → void
Updates the current value of the Pod via updateValue and calls notifyListeners if the returned value is different from the current value.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create<A extends Object, B extends Object>(String key, {required A fromValue(B? rawValue), required B toValue(A value), required A initialValue}) Future<SharedPod<A, B>>
Creates and initializes a SharedPod by loading its value from storage.