of static method

Returns the ShortKitController from the nearest ShortKitProvider ancestor, or throws a FlutterError if none is found.

Implementation

static ShortKitController of(BuildContext context) {
  final controller = maybeOf(context);
  if (controller == null) {
    throw FlutterError(
      'ShortKit.of() called with a context that does not contain a '
      'ShortKitProvider.\n'
      'Ensure a ShortKitProvider is an ancestor of the widget using '
      'ShortKit.of().',
    );
  }
  return controller;
}