findBeagleService function

BeagleService findBeagleService(
  1. BuildContext context
)

Implementation

BeagleService findBeagleService(BuildContext context) {
  final provider = context.findAncestorStateOfType<BeagleProviderState>();
  if (provider == null) {
    throw ErrorDescription(
        'A component that depends on Beagle has been used without a parent BeagleProvider. Please be sure to use a BeagleProvider to wrap your application code.');
  }
  /* provider.beagle can never be null. The provider guarantees this by not rendering any child until every async
  operation has completed. */
  return provider.beagle;
}