SharedProtectedPod<A extends Object, B extends Object> class
base
A SharedPod that protects addStrongRefListener and dispose, hiding
these methods from external access to prevent misuse or unintended behavior.
This is useful when you want to restrict direct access to lifecycle management methods of the Pod, ensuring that these operations are only handled internally or through controlled mechanisms.
Extends SharedPod and uses ProtectedPodMixin to encapsulate and manage
the protection of these critical methods.
- Inheritance
-
- Object
- WeakChangeNotifier
- DisposablePod<
A> - PodNotifier<
A> - RootPod<
A> - SharedPod<
A, B> - SharedProtectedPod
- Available extensions
Constructors
Properties
- fromValue → A Function(B? rawValue)
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- initialValue → A
-
finalinherited
- isDisposed → bool
-
Whether dispose has been called.
no setterinherited
- key → String
-
finalinherited
- onAfterDispose ↔ void Function()?
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toValue → B Function(A value)
-
finalinherited
- updateValue → A
-
Returns the current value of the Pod and calls refresh.
no setterinherited
- value ↔ A
-
The current value of the object.
getter/setter pairinherited
Methods
-
addListener(
VoidCallback listener) → void -
❌ Do not add listeners to this Pod directly.
inherited
-
addSingleExecutionListener(
VoidCallback listener) → void -
❌ Do not add listeners to this Pod directly.
inherited
-
addStrongRefListener(
{required VoidCallback strongRefListener}) → void -
❌ Do not add listeners to this Pod directly.
inherited
-
asChildPod<
TParent extends Object> () → ChildPod< TParent, T> -
Available on ValueListenable<
Casts the ValueListenable to a ChildPod.T> , provided by the ValueListenableExt extension -
asDisposablePod(
) → DisposablePod< T> -
Available on ValueListenable<
Casts the ValueListenable to a DisposablePod.T> , provided by the ValueListenableExt extension -
asGenericPod(
) → GenericPod< T> -
Available on ValueListenable<
Casts the ValueListenable to a GenericPod.T> , provided by the ValueListenableExt extension -
asProtectedPod(
) → ProtectedPod< T> -
Available on ValueListenable<
Casts the ValueListenable to a ProtectedPod.T> , provided by the ValueListenableExt extension -
asRootPod(
) → RootPod< T> -
Available on ValueListenable<
Casts the ValueListenable to a RootPod.T> , provided by the ValueListenableExt extension -
Available on ValueListenable<
Casts the ValueListenable to a SharedPod.T> , provided by the ValueListenableExt extension -
asValueListenable(
) → ValueListenable< T> -
Available on ValueListenable<
Returns the Pod as a ValueListenable.T> , provided by the ValueListenableExt extension -
cond(
bool test(A value)) → Resolvable< A> -
Returns the value of the Pod when the
testreturnstrue.inherited -
delete(
{bool notifyImmediately = true}) → Future< void> -
inherited
-
dispose(
) → void -
❌ Do not dispose this Pod directly.
inherited
-
disposeChildren(
) → void -
Disposes and removes all children.
inherited
-
getValue(
) → A -
inherited
-
map<
B extends Object> (B reducer(A value)) → ChildPod< A, B> -
Maps
thisGenericPod to a new ChildPod using the specifiedreducer.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
pinListener(
VoidCallback listener) → void -
Holds
listeneralive until unpinListener is called or this notifier is disposed. Intended for callers that pass addStrongRefListener a closure they themselves do not retain.inherited -
reduce<
C extends Object, O extends Object> (GenericPod< O> other, TReducerFn2<C, A, O> reducer) → ChildPod<Object, C> -
Reduces the current Pod and
otherinto a single ChildPod.inherited -
refresh(
{bool notifyImmediately = true}) → Future< void> -
Triggers notifyListeners after a zero-duration delay. Returns a
Future that completes once the notify has been scheduled and
(potentially) fired — callers that need to read post-notify state
can
awaitit.inherited -
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
newValueand calls notifyListeners if the value is different from the current value.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
unpinListener(
VoidCallback listener) → void -
Releases the strong reference taken by pinListener. Safe to call when
no pin exists.
inherited
-
update(
A updateValue(A oldValue), {bool notifyImmediately = true}) → void -
Updates the current value of the Pod via
updateValueand 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}) → Async< SharedProtectedPod< A, B> > -
Creates and initializes a SharedProtectedPod by loading its value from storage.
override