of<T extends KlineBlocBase> static method

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

Implementation

static T of<T extends KlineBlocBase>(BuildContext context) {
  final type = _typeOf<KlineBlocProvider<T>>();
  KlineBlocProvider<T>? provider = context.findAncestorWidgetOfExactType<KlineBlocProvider<T>>();
  return provider?.bloc ?? (throw FlutterError("KlineBlocProvider not found in context"));
}