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:
-
w100: Thin, the thinnest font weight.
-
w200: Extra light.
-
w400: Normal. The constant FontWeight.normal is an alias for this value.
-
w700: Bold. The constant FontWeight.bold is an alias for this value.
-
w900: Black, the thickest font weight.
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
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.