bindAsync method

void bindAsync(
  1. WidgetRef ref,
  2. ProviderListenable<AsyncValue<List<T>>> provider
)

Implementation

void bindAsync(
  WidgetRef ref,
  ProviderListenable<AsyncValue<List<T>>> provider,
) {
  handleAsyncValue(ref.read(provider));

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