of static method

ExpansionTileThemeData of(
  1. BuildContext context
)

Retrieves the ExpansionTileThemeData from the closest ancestor ExpansionTileTheme.

If there is no enclosing ExpansionTileTheme widget, then ThemeData.expansionTileTheme is used.

Typical usage is as follows:

ExpansionTileThemeData theme = ExpansionTileTheme.of(context);

Implementation

static ExpansionTileThemeData of(BuildContext context) {
  final ExpansionTileTheme? inheritedTheme = context
      .dependOnInheritedWidgetOfExactType<ExpansionTileTheme>();
  return inheritedTheme?.data ?? Theme.of(context).expansionTileTheme;
}