An immutable style in which paint text.

Static Methods

lerp(TextStyle begin, TextStyle end, double t) TextStyle

Interpolate between two text styles.

Constructors

TextStyle({bool inherit: true, Color color, String fontFamily, double fontSize, FontWeight fontWeight, FontStyle fontStyle, double letterSpacing, double wordSpacing, TextBaseline textBaseline, double height, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle })

Creates a text style.

const

Properties

color Color

The color to use when painting the text.

read-only
decoration TextDecoration

The decorations to paint near the text (e.g., an underline).

read-only
decorationColor Color

The color in which to paint the text decorations.

read-only
decorationStyle TextDecorationStyle

The style in which to paint the text decorations (e.g., dashed).

read-only
fontFamily String

The name of the font to use when painting the text (e.g., Roboto).

read-only
fontSize double

The size of glyphs (in logical pixels) to use when painting the text.

read-only
fontStyle FontStyle

The typeface variant to use when drawing the letters (e.g., italics).

read-only
fontWeight FontWeight

The typeface thickness to use when painting the text (e.g., bold).

read-only
hashCode int

read-only
height double

The height of this text span, as a multiple of the font size.

read-only
inherit bool

Whether null values are replaced with their value in an ancestor text style (e.g., in a TextSpan tree).

read-only
letterSpacing double

The amount of space (in logical pixels) to add between each letter.

read-only
textBaseline TextBaseline

The common baseline that should be aligned between this text span and its parent text span, or, for the root text spans, with the line box.

read-only
wordSpacing double

The amount of space (in logical pixels) to add at each sequence of white-space (i.e. between each word).

read-only
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

Methods

apply({Color color, String fontFamily, double fontSizeFactor: 1.0, double fontSizeDelta: 0.0, int fontWeightDelta: 0, double letterSpacingFactor: 1.0, double letterSpacingDelta: 0.0, double wordSpacingFactor: 1.0, double wordSpacingDelta: 0.0, double heightFactor: 1.0, double heightDelta: 0.0 }) TextStyle

Creates a copy of this text style but with the numeric fields multiplied by the given factors and then incremented by the given deltas.

copyWith({Color color, String fontFamily, double fontSize, FontWeight fontWeight, FontStyle fontStyle, double letterSpacing, double wordSpacing, TextBaseline textBaseline, double height, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle }) TextStyle

Creates a copy of this text style but with the given fields replaced with the new values.

getParagraphStyle({TextAlign textAlign, double textScaleFactor: 1.0, String ellipsis }) ParagraphStyle

The style information for paragraphs, encoded for use by dart:ui.

getTextStyle({double textScaleFactor: 1.0 }) TextStyle

The style information for text runs, encoded for use by dart:ui.

merge(TextStyle other) TextStyle

Returns a new text style that matches this text style but with some values replaced by the non-null parameters of the given text style. If the given text style is null, simply returns this text style.

toString([String prefix = '' ]) String

Returns a string representation of this object.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited