of static method

ScrollBehavior of(
  1. 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.dependOnInheritedWidgetOfExactType<ScrollConfiguration>();
  return configuration?.behavior ?? const ScrollBehavior();
}