FontVariation constructor Null safety

const FontVariation(
  1. String axis,
  2. double value
)

Creates a FontVariation object, which can be added to a TextStyle to change the variable attributes of a font.

axis is the four-character tag that identifies the design axis. These tags are specified by font formats such as OpenType. See https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg

value is the value that the axis will be set to. The behavior depends on how the font implements the axis.

Implementation

const FontVariation(
  this.axis,
  this.value,
) : assert(axis != null),
    assert(axis.length == 4, 'Axis tag must be exactly four characters long.'),
    assert(value != null);