of static method

_DetectScrollInherited of(
  1. BuildContext context
)

Allows descendants to get the scroll state. Example:

bool canScroll = DetectScroll.of(context).canScroll;
double width = DetectScroll.of(context).scrollbarWidth;

Implementation

static _DetectScrollInherited of(BuildContext context) {
  final inherited =
      context.dependOnInheritedWidgetOfExactType<_DetectScrollInherited>();

  assert(inherited != null, 'No DetectScroll found in context');
  return inherited!;
}