SvgTheme constructor

const SvgTheme({
  1. Color currentColor = const Color(0xFF000000),
  2. double fontSize = 14,
  3. double? xHeight,
})

Instantiates an SVG theme with the given currentColor and fontSize.

Defaults fontSize to 14, and calculates xHeight as half of the fontSize.

WARNING: If this codebase ever decides to default the font size to something based on the BuildContext, caching logic will need to be updated. The font size can temporarily change during route transitions, affecting performance.

Implementation

const SvgTheme({
  this.currentColor = const Color(0xFF000000),
  this.fontSize = 14,
  double? xHeight,
}) : xHeight = xHeight ?? fontSize / 2;