ScopedValueRef class abstract
Ref associated with the widget.
ウィジェットに関連するRef。
Base class for References passed from ScopedWidget, etc.
This can be extended with an extension to add a method for handling ScopedValue.
In that case, use getScopedValue to generate and pass ScopedValue.
ScopedWidget等から渡されるReferenceのベースクラス。
これをextensionで拡張することでScopedValueを扱うメソッドを追加することができます。
その場合、getScopedValueでScopedValueを生成して渡してください。
extension RefCacheExtensions on Ref {
T cache<T>(
T Function() callback, {
List<Object> keys = const [],
}) {
return getState<T, _CacheValue<T>>(
() => _CacheValue<T>(callback: callback, keys: keys),
listen: false,
);
}
}
- Implemented types
- Implementers
- Available Extensions
- Annotations
Properties
- context → BuildContext
-
BuildContext of the associated widget.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- 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.override -
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
.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override