of<T extends Sampod> static method

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

Implementation

static T of<T extends Sampod>(BuildContext context) {
  final SampodProvider<T>? result =
      context.dependOnInheritedWidgetOfExactType<SampodProvider<T>>();
  if (result == null) {
    throw FlutterError('SampodProvider<$T> not found in the widget tree.');
  }
  return result.controller;
}