PageOrWidgetScopedValueRef class abstract
ScopedValueRef of the Page or Widget (whose state can be monitored).
This can be extended with an extension to add a method to handle ScopedValue that stores a value per page.
PageもしくはWidget(状態を監視可能なもの)のScopedValueRef。
これをextensionで拡張することでページごとに値を保存するScopedValueを扱うメソッドを追加することができます。
extension RefWatchExtensions on PageOrWidgetScopedValueRef {
T watch<T extends Listenable>(
T Function() callback, {
List<Object> keys = const [],
}) {
return getScopedValue<T, _WatchValue<T>>(
() => _WatchValue<T>(callback: callback, keys: keys),
listen: true,
);
}
}
- Implemented types
- Implementers
- Available extensions
- PageOrWidgetScopedValueRefCacheExtensions
- PageOrWidgetScopedValueRefFutureExtensions
- PageOrWidgetScopedValueRefOnExtensions
- PageOrWidgetScopedValueRefPeriodicExtensions
- PageOrWidgetScopedValueRefRefreshExtensions
- PageOrWidgetScopedValueRefScheduleExtensions
- PageOrWidgetScopedValueRefTimerExtensions
- PageOrWidgetScopedValueRefWatchExtensions
- PageScopedValueRefAncestorExtensions
- RefCacheExtensions
- RefFutureExtensions
- RefQueryExtensions
- RefWatchExtensions
- Annotations
Constructors
Properties
- context → BuildContext
-
BuildContext of the associated widget.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getAlreadyExistsScopedValue<
TResult, TScopedValue extends ScopedValue< (TResult> >{Object? name, bool listen = false, bool recursive = true}) → TResult? -
Obtains a
TScopedValue
already stored in ScopedValueContainer.inherited -
getScopedValue<
TResult, TScopedValue extends ScopedValue< (TResult> >TScopedValue provider(Ref ref), {void onInit(ScopedValueState< TResult, TScopedValue> state)?, void onUpdate(ScopedValueState<TResult, TScopedValue> state)?, bool listen = false, Object? name}) → TResult -
A method that returns the value of
TResult
while creating, saving, and managing the state ofTScopedValue
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited