AppScopedValueOrAppRef class abstract

AppRef or AppScopedValueRef to store state in App scope.

This can be extended with an extension to add a method to handle Ref that stores the value for each app.

Appスコープで状態を保存するAppRefもしくはAppScopedValueRef

これをextensionで拡張することでアプリごとに値を保存するRefを扱うメソッドを追加することができます。

extension RefWatchExtensions on AppScopedValueOrAppRef {
  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
Annotations

Constructors

AppScopedValueOrAppRef()

Properties

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 of TScopedValue.
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