maybeOf static method

ScrollController? maybeOf(
  1. BuildContext context
)

Returns the ScrollController most closely associated with the given context.

Returns null if there is no ScrollController associated with the given context.

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

See also:

Implementation

static ScrollController? maybeOf(BuildContext context) {
  final PrimaryScrollController? result = context.dependOnInheritedWidgetOfExactType<PrimaryScrollController>();
  return result?.controller;
}