of method

ScrollBehavior of (BuildContext context)

The ScrollBehavior for Scrollable widgets in the given BuildContext.

If no ScrollConfiguration widget is in scope of the given context, a default ScrollBehavior instance is returned.

Implementation

static ScrollBehavior of(BuildContext context) {
  final ScrollConfiguration configuration = context.inheritFromWidgetOfExactType(ScrollConfiguration);
  return configuration?.behavior ?? const ScrollBehavior();
}