paramsOf<W extends Scope<W, D, S>, D extends ScopeDependencies, S extends ScopeState<W, D, S>> static method

W paramsOf<W extends Scope<W, D, S>, D extends ScopeDependencies, S extends ScopeState<W, D, S>>(
  1. BuildContext context, {
  2. required bool listen,
})
override

Looks up and returns the parameters of the scope W.

If listen is true, the widget will be rebuilt when the scope changes.

Implementation

static W paramsOf<W extends Scope<W, D, S>, D extends ScopeDependencies,
        S extends ScopeState<W, D, S>>(
  BuildContext context, {
  required bool listen,
}) =>
    listen
        ? ScopeContext.select<W, _ScopeElement<W, D, S>, W>(
            context,
            (element) => element.widget,
          )
        : ScopeContext.of<W, _ScopeElement<W, D, S>>(
            context,
            listen: false,
          ).widget;