of static method

The data from the closest instance of this class that encloses the given context.

Typical usage is as follows:

TextTileThemeData style = TextTileTheme.of(context);

Implementation

static TextTileThemeData of(BuildContext context) {
  final parentTheme =
      context.dependOnInheritedWidgetOfExactType<TextTileTheme>();
  if (parentTheme != null) return parentTheme.data;

  final globalTheme = Theme.of(context).extension<TextTileThemeData>();
  final defaultTheme = TextTileThemeData.defaults(context);
  return defaultTheme.merge(globalTheme);
}