An immutable style in which paint text.

Annotations
  • immutable

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.

final
decoration TextDecoration

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

final
decorationColor Color

The color in which to paint the text decorations.

final
decorationStyle TextDecorationStyle

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

final
fontFamily String

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

final
fontSize double

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

final
fontStyle FontStyle

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

final
fontWeight FontWeight

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

final
hashCode int

read-only
height double

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

final
inherit bool

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

final
letterSpacing double

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

final
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.

final
wordSpacing double

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

final
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, int maxLines }) 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