paramsOf<W extends ScopeCore<W, E, D, S>, E extends ScopeCoreElement<W, E, D, S>, D extends ScopeDependencies, S extends ScopeCoreState<W, E, D, S>> static method

W paramsOf<W extends ScopeCore<W, E, D, S>, E extends ScopeCoreElement<W, E, D, S>, D extends ScopeDependencies, S extends ScopeCoreState<W, E, 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 ScopeCore<W, E, D, S>,
  E extends ScopeCoreElement<W, E, D, S>,
  D extends ScopeDependencies,
  S extends ScopeCoreState<W, E, D, S>
>(BuildContext context, {required bool listen}) => listen
    ? ScopeInheritedContext.select<W, E, W>(
        context,
        (element) => element.widget,
      )
    : ScopeInheritedContext.of<W, E>(context, listen: false).widget;