of static method

Returns the configuration data from the closest ScrollbarTheme ancestor. If there is no ancestor, it returns ThemeData.scrollbarTheme.

Typical usage is as follows:

ScrollbarThemeData theme = ScrollbarTheme.of(context);

Implementation

static ScrollbarThemeData of(BuildContext context) {
  final ScrollbarTheme? scrollbarTheme =
      context.dependOnInheritedWidgetOfExactType<ScrollbarTheme>();
  return scrollbarTheme?.data ?? MacosTheme.of(context).scrollbarTheme;
}