of<T extends BLoC> method

T of <T extends BLoC>(
  1. BuildContext context
)

Implementation

static T of<T extends BLoC>(BuildContext context) {
  final type = _typeOf<_BLoCProviderInherited<T>>();
  _BLoCProviderInherited<T> provider =
      context.ancestorInheritedElementForWidgetOfExactType(type)?.widget;
  return provider?.bloc;
}