AppScopedValueRef class

ScopedValueRef of the application.

This can be extended with an extension to add a method to handle ScopedValue that stores a value per page.

アプリケーションのScopedValueRef

これをextensionで拡張することでページごとに値を保存するScopedValueを扱うメソッドを追加することができます。

extension RefWatchExtensions on AppScopedValueRef {
  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,
    );
  }
}
Inheritance
Implemented types
Available extensions
Annotations

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

cache<T>(T callback(QueryScopedValueRef<Ref> ref), {List<Object> keys = const [], Object? name}) → T

Available on Ref, provided by the RefCacheExtensions extension

controller<TController extends Listenable>(ControllerQueryBase<TController> query, {bool? autoDisposeWhenUnreferenced}) → TController

Available on PageOrAppScopedValueOrAppRef, provided by the MasamuneControllerPageOrAppScopedValueOrAppRefExtensions extension

A TController whose state is retained is obtained by passing the ControllerQueryBase generated by the builder.
fetch<T>([Object? name]) → T?

Available on AppScopedValueOrAppRef, provided by the RefFetchExtensions extension

form<TModel>(FormControllerQueryBase<TModel> query, {bool? autoDisposeWhenUnreferenced}) FormController<TModel>

Available on PageOrAppScopedValueOrAppRef, provided by the MasamuneFormPageScopedValueRefExtensions extension

FormController is obtained by passing FormControllerQueryBase for the form generated by the builder.
future<T>(FutureOr<T> callback(), {List<Object> keys = const [], Object? name}) FutureContext<T>

Available on Ref, provided by the RefFutureExtensions extension

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
model<TModel extends Listenable>(ModelQueryBase<TModel> query) → TModel

Available on AppScopedValueOrAppRef, provided by the MasamuneModelAppScopedValueOrAppRefExtensions extension

Retrieve the state-preserved TModel by passing the ModelQueryBase code generated by the builder.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query<T, TRef extends Ref>(ScopedQueryBase<T, TRef> query, {bool? autoDisposeWhenUnreferenced}) → T

Available on Ref, provided by the RefQueryExtensions extension

It is possible to manage the status by passing query.
toString() String
A string representation of this object.
inherited
watch<T extends Listenable?>(T callback(QueryScopedValueRef<Ref> ref), {List<Object> keys = const [], Object? name, bool disposal = true, bool autoDisposeWhenUnreferenced = false}) → T

Available on Ref, provided by the RefWatchExtensions extension

Operators

operator ==(Object other) bool
The equality operator.
inherited