maybeOf<T> static method

SuggestionsController<T>? maybeOf<T>(
  1. BuildContext context
)

Returns the SuggestionsController of the closest ancestor SuggestionsBox or null if none exists.

Implementation

static SuggestionsController<T>? maybeOf<T>(BuildContext context) {
  return context
      .dependOnInheritedWidgetOfExactType<SuggestionsControllerProvider<T>>()
      ?.notifier;
}