of static method

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

Typical usage is as follows:

TileThemeData theme = TileTheme.of(context);

Implementation

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

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