optionsOf<T extends Object> static method

InteractiveOptions<T> optionsOf<T extends Object>(
  1. BuildContext context,
  2. String scopeName
)

Looks up the InteractiveOptions from the nearest ancestor scope.

Throws FlutterError if no ancestor scope is found.

Implementation

static InteractiveOptions<T> optionsOf<T extends Object>(
  BuildContext context,
  String scopeName,
) {
  final options = maybeOptionsOf<T>(context);
  if (options == null) {
    throw FlutterError(
      'InteractiveOptions.of() called without an `$scopeName` ancestor.',
    );
  }
  return options;
}