of method Null safety

ScrollController? of(
  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.

Implementation

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