QueryScopedValueRef<TRef extends Ref> class

Ref used inside ScopedQuery.

ScopedQueryの内部で使用される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を扱うメソッドを追加することができます。

その場合、getScopedValueScopedValueを生成して渡してください。

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
Available Extensions
Annotations

Properties

hashCode int
The hash code for this object.
no setteroverride
ref → TRef
final
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 of TScopedValue.
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