bindAsyncMap<S> method

void bindAsyncMap<S>(
  1. WidgetRef ref,
  2. ProviderListenable<AsyncValue<S>> provider, {
  3. required List<T> map(
    1. S v
    ),
})

Implementation

void bindAsyncMap<S>(
  WidgetRef ref,
  ProviderListenable<AsyncValue<S>> provider, {
  required List<T> Function(S v) map,
}) {
  handleAsyncValueMap(ref.read(provider), map);

  try {
    ref.listen(
      provider,
      (_, next) => handleAsyncValueMap(next, map),
    );
  } catch (_) {
    ref.container.listen(
      provider,
      (previous, next) => handleAsyncValueMap(next, map),
    );
  }
}