of static method

CarouselViewThemeData of(
  1. BuildContext context
)

Returns the configuration data from the closest CarouselViewTheme ancestor.

If there is no ancestor, it returns ThemeData.carouselViewTheme.

Typical usage is as follows:

CarouselViewThemeData theme = CarouselViewTheme.of(context);

Implementation

static CarouselViewThemeData of(BuildContext context) {
  final CarouselViewTheme? inheritedTheme = context
      .dependOnInheritedWidgetOfExactType<CarouselViewTheme>();
  return inheritedTheme?.data ?? Theme.of(context).carouselViewTheme;
}