getAlreadtExistsScopedValueResult<TResult, TScopedValue extends ScopedValue<TResult>> method

  1. @override
TResult? getAlreadtExistsScopedValueResult<TResult, TScopedValue extends ScopedValue<TResult>>({
  1. bool listen = false,
  2. Object? name,
  3. bool recursive = true,
})
inherited

Retrieves the ScopedValueState associated with the TScopedValue already stored in the ScopedValueContainer and returns the result.

Returns Null if TScopedValue does not exist.

If TScopedValue was saved with name, specify the same name.

If listen is true, then it should be associated with the widget to notify it of changes.

If recursive is true, the search is recursive from child to parent in the same scope.

ScopedValueState.setState, ScopedValueState.initValue and ScopedValueState.didUpdateValue are not executed.

ScopedValueContainerにすでに保存されているTScopedValueに関連するScopedValueStateを取得し、その結果を返します。

TScopedValueが存在しない場合はNullを返します。

nameを指定してTScopedValueを保存していた場合、同じnameを指定してください。

listentrueの場合、ウィジェットに関連付けて変更を通知するようにします。

recursivetrueな場合、同じスコープの子から親へと再帰的に検索します。

ScopedValueState.setStateScopedValueState.initValueScopedValueState.didUpdateValueは実行されません。

Implementation

@override
TResult? getAlreadtExistsScopedValueResult<TResult,
    TScopedValue extends ScopedValue<TResult>>({
  bool listen = false,
  Object? name,
  bool recursive = true,
}) {
  final res = super.getAlreadtExistsScopedValueResult<TResult, TScopedValue>(
    listen: listen,
    name: name,
  );
  if (res != null || !recursive) {
    return res;
  }
  return _PageScopedScope.maybeOf(_context)
      ?._pageListener
      .getAlreadtExistsScopedValueResult<TResult, TScopedValue>(
        listen: listen,
        name: name,
      );
}