of static method

Implementation

static DependencyProvider of(BuildContext context) {
  final provider = context.dependOnInheritedWidgetOfExactType<ContainerProvider>();
  if (provider == null) {
    throw FlutterError(
      'ContainerProvider.of() called with a context that does not contain a ContainerProvider.\n'
          'No "WidgetScope" ancestor could be found starting from the context that was passed.',
    );
  }
  return provider.container;
}