select<M extends Listenable, V extends Object?> static method

V select<M extends Listenable, V extends Object?>(
  1. BuildContext context,
  2. V selector(
    1. M model
    )
)
override

Subscribes to one value of the model and returns it.

The caller is rebuilt on notifyListeners, and only when that value has changed.

Implementation

static V select<M extends Listenable, V extends Object?>(
  BuildContext context,
  V Function(M model) selector,
) =>
    ScopeInheritedContext.select<
      ScopeNotifier<M>,
      ScopeModelContext<ScopeNotifier<M>, M>,
      V
    >(context, (context) => selector(context.model));