FontWeight class

The thickness of the glyphs used to draw the text.

Values must be in the range 1..1000.

Fonts are typically weighted on a 9-point scale, which, for historical reasons, uses the names 100 to 900. In Flutter, these are named w100 to w900 and have the following conventional meanings:

For example, the font named "Roboto Medium" is typically exposed as a font with the name "Roboto" and the weight FontWeight.w500.

Some modern fonts allow the weight to be adjusted in arbitrary increments. When using these fonts, applications can specify FontWeight instances constructed using values other than the predefined values. For these fonts, FontWeight will set the value of the wght axis (producing the same results as explicitly setting that attribute using FontVariation.weight).

Constructors

FontWeight(int value)
Creates a FontWeight object, which can be added to a TextStyle to select the thickness of a font's glyphs.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
index int
The encoded integer value of this font weight.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value int
The thickness value of this font weight.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

lerp(FontWeight? a, FontWeight? b, double t) FontWeight?
Linearly interpolates between two font weights.

Constants

bold → const FontWeight
A commonly used font weight that is heavier than normal.
normal → const FontWeight
The default font weight.
values → const List<FontWeight>
A list of all the font weights.
w100 → const FontWeight
Thin, the least thick.
w200 → const FontWeight
Extra-light.
w300 → const FontWeight
Light.
w400 → const FontWeight
Normal / regular / plain.
w500 → const FontWeight
Medium.
w600 → const FontWeight
Semi-bold.
w700 → const FontWeight
Bold.
w800 → const FontWeight
Extra-bold.
w900 → const FontWeight
Black, the most thick.