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 WxTextTileThemeData of(BuildContext context) {
  final parentTheme =
      context.dependOnInheritedWidgetOfExactType<WxTextTileTheme>();
  if (parentTheme != null) return parentTheme.data;

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