of static method

Implementation

static CockpitSurfaceState of(BuildContext context) {
  final state = maybeOf(context);
  if (state == null) {
    throw StateError('No CockpitSurface found in the current BuildContext.');
  }
  return state;
}