maybeOptionsOf<T extends Object> static method

InteractiveOptions<T>? maybeOptionsOf<T extends Object>(
  1. BuildContext context
)

Looks up the InteractiveOptions from the nearest ancestor scope.

Returns null if no ancestor scope is found.

Implementation

static InteractiveOptions<T>? maybeOptionsOf<T extends Object>(
  BuildContext context,
) {
  final scope = context
      .dependOnInheritedWidgetOfExactType<InheritedInteractiveScope<T>>();
  return scope?.options;
}