of static method

The nearest scope's controller; throws when no scope is mounted.

Implementation

static CockpitRecorderController of(BuildContext context) {
  final controller = maybeOf(context);
  if (controller == null) {
    throw FlutterError(
      'CockpitRecorderScope.of called with a context that has no '
      'CockpitRecorderScope ancestor. Enable the interaction recorder in '
      'FlutterCockpitConfiguration, or mount a scope around the panel.',
    );
  }
  return controller;
}