of static method

TileThemeData of(
  1. BuildContext context
)

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

Typical usage is as follows:

TileThemeData theme = TileTheme.of(context);

Implementation

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

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