select<T extends Object?, V extends Object?> static method

V select<T extends Object?, V extends Object?>(
  1. BuildContext context,
  2. V selector(
    1. AsyncDataScopeContext<AsyncDataScope<T>, T> context
    )
)
override

Subscribes to one value of the scope and returns it.

The data type comes first and the selected type second, as everywhere else: AsyncDataScope.select<Profile, String>(context, …) selects a String out of a scope holding a Profile.

Implementation

static V select<T extends Object?, V extends Object?>(
  BuildContext context,
  V Function(AsyncDataScopeContext<AsyncDataScope<T>, T> context) selector,
) =>
    ScopeContext.select<AsyncDataScope<T>,
        AsyncDataScopeContext<AsyncDataScope<T>, T>, V>(
      context,
      selector,
    );