Material design text theme.

Definitions for the various typographical styles found in material design (e.g., headline, caption). Rather than creating a TextTheme directly, you can obtain an instance as Typography.black or Typography.white.

To obtain the current text theme, call Theme.of with the current BuildContext and read the ThemeData.textTheme property.

The following image from the material design specification shows the recommended styles for each of the properties of a TextTheme. This image uses the Roboto font, which is the font used on Android. On iOS, the San Francisco font is automatically used instead.

To see the image, visit the typography site referenced below.

See also:

Annotations
  • @immutable

Constructors

TextTheme({TextStyle display4, TextStyle display3, TextStyle display2, TextStyle display1, TextStyle headline, TextStyle title, TextStyle subhead, TextStyle body2, TextStyle body1, TextStyle caption, TextStyle button })
Creates a text theme that uses the given values. [...]
const

Properties

body1 TextStyle
Used for the default text style for Material.
final
body2 TextStyle
Used for emphasizing text that would otherwise be body1.
final
button TextStyle
Used for text on RaisedButton and FlatButton.
final
caption TextStyle
Used for auxiliary text associated with images.
final
display1 TextStyle
Large text.
final
display2 TextStyle
Very large text.
final
display3 TextStyle
Very, very large text. [...]
final
display4 TextStyle
Extremely large text. [...]
final
hashCode int
The hash code for this object. [...]
read-only
headline TextStyle
Used for large text in dialogs (e.g., the month and year in the dialog shown by showDatePicker).
final
subhead TextStyle
Used for the primary text in lists (e.g., ListTile.title).
final
title TextStyle
Used for the primary text in app bars and dialogs (e.g., AppBar.title and AlertDialog.title).
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

apply({String fontFamily, double fontSizeFactor: 1.0, double fontSizeDelta: 0.0, Color displayColor, Color bodyColor, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle }) TextTheme
Creates a copy of this text theme but with the given field replaced in each of the individual text styles. [...]
copyWith({TextStyle display4, TextStyle display3, TextStyle display2, TextStyle display1, TextStyle headline, TextStyle title, TextStyle subhead, TextStyle body2, TextStyle body1, TextStyle caption, TextStyle button }) TextTheme
Creates a copy of this text theme but with the given fields replaced with the new values. [...]
merge(TextTheme other) TextTheme
Creates a new TextTheme where each text style from this object has been merged with the matching text style from the other object. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(other) bool
The equality operator. [...]

Static Methods

lerp(TextTheme begin, TextTheme end, double t) TextTheme
Linearly interpolate between two text themes.