SharedProtectedPod<A, B> 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
→ FutureOr<
A?> ? Function(B? rawValue) -
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
no setterinherited
- initialValue → A?
-
finalinherited
- isDisposed → bool
-
Whether this Pod has been disposed of or not.
no setterinherited
- key → String
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
toDisposeResources
→ Set<
_ToDisposeResource> -
The list of resources marked for dispose via
willDispose
.no setterinherited -
toValue
→ FutureOr<
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. When the value changes, the callbacks
registered with addListener will be invoked.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
❌ Do not use this method directly. Use addStrongRefListener instead.
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> () → ChildPod< TParent, T> -
Available on ValueListenable<
Casts the ValueListenable to a ChildPod.T> , provided by the CastPodListenableX extension -
asDisposablePod(
) → DisposablePod< T> -
Available on ValueListenable<
Casts the ValueListenable to a DisposablePod.T> , provided by the CastPodListenableX extension -
asGenericPod(
) → GenericPod< T> -
Available on ValueListenable<
Casts the ValueListenable to a GenericPod.T> , provided by the CastPodListenableX extension -
asPodDisposable(
) → DisposablePod< T> -
Available on ValueListenable<
T> , provided by the CastPodListenableX extension -
asProtectedPod(
) → ProtectedPod< T> -
Available on ValueListenable<
Casts the ValueListenable to a ProtectedPod.T> , provided by the CastPodListenableX extension -
asRootPod(
) → RootPod< T> -
Available on ValueListenable<
Casts the ValueListenable to a RootPod.T> , provided by the CastPodListenableX extension -
Available on ValueListenable<
Casts the ValueListenable to a SharedPod.T> , provided by the CastPodListenableX extension -
asValueListenable(
) → ValueListenable< T> -
Available on ValueListenable<
Returns the Pod as a ValueListenable.T> , provided by the CastPodListenableX extension -
cond(
bool test(A? value)) → FutureOr< A?> -
Returns the value of the Pod when the
test
returnstrue
.inherited -
dispose(
) → void -
❌ Do not dispose this Pod directly.
inherited
-
disposeChildren(
) → void -
Disposes and removes all children.
inherited
-
map<
B> (B reducer(A? value)) → ChildPod< A?, B> -
Maps
this
GenericPod to a new ChildPod using the specifiedreducer
.inherited -
nonNull<
T1 extends T> () → FutureOr< T1> -
Returns the value of the Pod when it is not
null
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
inherited
-
reduce<
C, O> (GenericPod< O> other, TReducerFn2<C, A?, O> reducer) → ChildPod<dynamic, C> -
Reduces the current Pod and
other
into a single ChildPod.inherited -
refresh(
) → Future< void> -
Triggers notifyListeners after a zero-duration delay.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies.
inherited
-
set(
A? newValue) → Future< void> -
Sets the value of the Pod to
newValue
and calls notifyListeners if the value is different from the current value.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
update(
A? updateValue(A? oldValue)) → void -
Updates the current value of the Pod via
updateValue
and calls notifyListeners if the returned value is different from the current value.inherited -
willDispose<
T> (T resource, {_OnBeforeCallback< T> ? onBeforeDispose}) → T -
Marks the
resource
for dispose.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited