Typography class Null safety

The color and geometry TextThemes for Material apps.

The text theme provided by the overall Theme, ThemeData.textTheme, is based on the current locale's MaterialLocalizations.scriptCategory and is created by merging a color text theme - black for Brightness.light themes and white for Brightness.dark themes - and a geometry text theme, one of englishLike, dense, or tall, depending on the locale.

To lookup the localized text theme use Theme.of(context).textTheme.

The color text themes are blackMountainView, whiteMountainView, blackCupertino, and whiteCupertino. The Mountain View theme TextStyles are based on the Roboto fonts as used on Android. The Cupertino themes are based on the San Francisco font fonts as used by Apple on iOS.

Two sets of geometry themes are provided: 2014 and 2018. The 2014 themes correspond to the original version of the Material Design spec and are the defaults. The 2018 themes correspond the second iteration of the specification and feature different font sizes, font weights, and letter spacing values.

By default, ThemeData.typography is Typography.material2014(platform: platform) which uses englishLike2014, dense2014 and tall2014. To use the 2018 text theme geometries, specify a value using the material2018 constructor:

typography: Typography.material2018(platform: platform)

See also:

Mixed in types
Annotations

Constructors

Typography({TargetPlatform? platform, TextTheme? black, TextTheme? white, TextTheme? englishLike, TextTheme? dense, TextTheme? tall})
Creates a typography instance.
factory
Typography.material2014({TargetPlatform? platform = TargetPlatform.android, TextTheme? black, TextTheme? white, TextTheme? englishLike, TextTheme? dense, TextTheme? tall})
Creates a typography instance using Material Design's 2014 defaults.
factory
Typography.material2018({TargetPlatform? platform = TargetPlatform.android, TextTheme? black, TextTheme? white, TextTheme? englishLike, TextTheme? dense, TextTheme? tall})
Creates a typography instance using Material Design's 2018 defaults.
factory
Typography.material2021({TargetPlatform? platform = TargetPlatform.android, TextTheme? black, TextTheme? white, TextTheme? englishLike, TextTheme? dense, TextTheme? tall})
Creates a typography instance using Material Design 3 2021 defaults.
factory

Properties

black TextTheme
A Material Design text theme with dark glyphs.
final
dense TextTheme
Defines text geometry for dense scripts, such as Chinese, Japanese and Korean.
final
englishLike TextTheme
Defines text geometry for ScriptCategory.englishLike scripts, such as English, French, Russian, etc.
final
hashCode int
The hash code for this object.
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
tall TextTheme
Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai.
final
white TextTheme
A Material Design text theme with light glyphs.
final

Methods

copyWith({TextTheme? black, TextTheme? white, TextTheme? englishLike, TextTheme? dense, TextTheme? tall}) Typography
Creates a copy of this Typography with the given fields replaced by the non-null parameter values.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
geometryThemeFor(ScriptCategory category) TextTheme
Returns one of englishLike, dense, or tall.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

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

Static Methods

lerp(Typography a, Typography b, double t) Typography
Linearly interpolate between two Typography objects.

Constants

blackCupertino → const TextTheme
A Material Design text theme with dark glyphs based on San Francisco.
TextTheme(displayLarge: TextStyle(debugLabel: 'blackCupertino displayLarge', fontFamily: '.SF UI Display', color: Colors.black54, decoration: TextDecoration.none), displayMedium: TextS…
blackHelsinki → const TextTheme
A Material Design text theme with dark glyphs based on Roboto, with fallback fonts that are likely (but not guaranteed) to be installed on Linux.
TextTheme(displayLarge: TextStyle(debugLabel: 'blackHelsinki displayLarge', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black54, decoration: TextDec…
blackMountainView → const TextTheme
A Material Design text theme with dark glyphs based on Roboto.
TextTheme(displayLarge: TextStyle(debugLabel: 'blackMountainView displayLarge', fontFamily: 'Roboto', color: Colors.black54, decoration: TextDecoration.none), displayMedium: TextStyle(…
blackRedmond → const TextTheme
A Material Design text theme with dark glyphs based on Segoe UI.
TextTheme(displayLarge: TextStyle(debugLabel: 'blackRedmond displayLarge', fontFamily: 'Segoe UI', color: Colors.black54, decoration: TextDecoration.none), displayMedium: TextStyle(deb…
blackRedwoodCity → const TextTheme
A Material Design text theme with dark glyphs based on San Francisco.
TextTheme(displayLarge: TextStyle(debugLabel: 'blackRedwoodCity displayLarge', fontFamily: '.AppleSystemUIFont', color: Colors.black54, decoration: TextDecoration.none), displayMedium:…
dense2014 → const TextTheme
Defines text geometry for dense scripts, such as Chinese, Japanese and Korean.
TextTheme(displayLarge: TextStyle(debugLabel: 'dense displayLarge 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), displayMedium: T…
dense2018 → const TextTheme
Defines text geometry for dense scripts, such as Chinese, Japanese and Korean.
TextTheme(displayLarge: TextStyle(debugLabel: 'dense displayLarge 2018', fontSize: 96.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), displayMedium: TextStyle(debugLab…
dense2021 → const TextTheme
Defines text geometry for dense scripts, such as Chinese, Japanese and Korean.
_M3Typography.dense
englishLike2014 → const TextTheme
Defines text geometry for ScriptCategory.englishLike scripts, such as English, French, Russian, etc.
TextTheme(displayLarge: TextStyle(debugLabel: 'englishLike displayLarge 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.alphabetic), displayMedi…
englishLike2018 → const TextTheme
Defines text geometry for ScriptCategory.englishLike scripts, such as English, French, Russian, etc.
TextTheme(displayLarge: TextStyle(debugLabel: 'englishLike displayLarge 2018', fontSize: 96.0, fontWeight: FontWeight.w300, textBaseline: TextBaseline.alphabetic, letterSpacing: -1.5), display…
englishLike2021 → const TextTheme
Defines text geometry for ScriptCategory.englishLike scripts, such as English, French, Russian, etc.
_M3Typography.englishLike
tall2014 → const TextTheme
Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai.
TextTheme(displayLarge: TextStyle(debugLabel: 'tall displayLarge 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), displayMedium: Tex…
tall2018 → const TextTheme
Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai.
TextTheme(displayLarge: TextStyle(debugLabel: 'tall displayLarge 2018', fontSize: 96.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), displayMedium: TextStyle(debugLabel…
tall2021 → const TextTheme
Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai.
_M3Typography.tall
whiteCupertino → const TextTheme
A Material Design text theme with light glyphs based on San Francisco.
TextTheme(displayLarge: TextStyle(debugLabel: 'whiteCupertino displayLarge', fontFamily: '.SF UI Display', color: Colors.white70, decoration: TextDecoration.none), displayMedium: TextS…
whiteHelsinki → const TextTheme
A Material Design text theme with light glyphs based on Roboto, with fallbacks of DejaVu Sans, Liberation Sans and Arial.
TextTheme(displayLarge: TextStyle(debugLabel: 'whiteHelsinki displayLarge', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white70, decoration: TextDec…
whiteMountainView → const TextTheme
A Material Design text theme with light glyphs based on Roboto.
TextTheme(displayLarge: TextStyle(debugLabel: 'whiteMountainView displayLarge', fontFamily: 'Roboto', color: Colors.white70, decoration: TextDecoration.none), displayMedium: TextStyle(…
whiteRedmond → const TextTheme
A Material Design text theme with light glyphs based on Segoe UI.
TextTheme(displayLarge: TextStyle(debugLabel: 'whiteRedmond displayLarge', fontFamily: 'Segoe UI', color: Colors.white70, decoration: TextDecoration.none), displayMedium: TextStyle(deb…
whiteRedwoodCity → const TextTheme
A Material Design text theme with light glyphs based on San Francisco.
TextTheme(displayLarge: TextStyle(debugLabel: 'whiteRedwoodCity displayLarge', fontFamily: '.AppleSystemUIFont', color: Colors.white70, decoration: TextDecoration.none), displayMedium:…