ScrollableState of(BuildContext context)

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

Typical usage is as follows:

ScrollableState scrollable = Scrollable.of(context);

Source

static ScrollableState of(BuildContext context) {
  return context.ancestorStateOfType(const TypeMatcher<ScrollableState>());
}