maybeOf static method

ScrollNotificationObserverState? maybeOf(
  1. BuildContext context
)

The closest instance of this class that encloses the given context.

If there is no enclosing ScrollNotificationObserver widget, then null is returned.

Calling this method will create a dependency on the closest ScrollNotificationObserver in the context, if there is one.

See also:

Implementation

static ScrollNotificationObserverState? maybeOf(BuildContext context) {
  return context.dependOnInheritedWidgetOfExactType<_ScrollNotificationObserverScope>()?._scrollNotificationObserverState;
}