Typography class
The color and geometry TextThemes
for Material apps.
The text themes provided by the overall Theme, like ThemeData.textTheme, are based on the current locale's MaterialLocalizations.scriptCategory and are created by merging a color text theme, black or white and a geometry text theme, one of englishLike, dense, or tall, depending on the locale.
To lookup a localized text theme use
Theme.of(context).textTheme
or
Theme.of(context).primaryTextTheme
or
Theme.of(context).accentTextTheme
.
The color text themes are blackMountainView,
whiteMountainView, and blackCupertino and whiteCupertino. The
Mountain View theme TextStyles
are based on the Roboto fonts and the
Cupertino themes are based on the San Francisco fonts.
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(platform: platform)
which uses englishLike2014,
dense2014 and tall2014. To use the 2018 text theme
geometries, specify a typography value:
Typography(
platorm: platform,
englishLike: Typography.englishLike2018,
dense: Typography.dense2018,
tall: Typography.tall2018,
)
See also:
- ThemeData.typography, which can be used to configure the text themes used to create ThemeData.textTheme, ThemeData.primaryTextTheme, ThemeData.accentTextTheme.
- material.io/design/typography/
- Inheritance
- Object
- Diagnosticable
- Typography
- Annotations
- @immutable
Constructors
- Typography({TargetPlatform platform, TextTheme black, TextTheme white, TextTheme englishLike, TextTheme dense, TextTheme tall })
-
Creates a typography instance. [...]
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
- 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
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
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
toStringDeep
. [...]inherited -
toString(
{DiagnosticLevel minLevel: DiagnosticLevel.debug }) → String -
Returns 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. [...]
const TextTheme(display4: const TextStyle(debugLabel: 'blackCupertino display4', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none), d…
- blackMountainView → const TextTheme
-
A material design text theme with dark glyphs based on Roboto. [...]
const TextTheme(display4: const TextStyle(debugLabel: 'blackMountainView display4', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), displa…
- dense2014 → const TextTheme
-
Defines text geometry for dense scripts, such as Chinese, Japanese
and Korean.
const TextTheme(display4: const TextStyle(debugLabel: 'dense display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), display3: co…
- dense2018 → const TextTheme
-
Defines text geometry for dense scripts, such as Chinese, Japanese
and Korean. [...]
const TextTheme(display4: const TextStyle(debugLabel: 'dense display4 2018', fontSize: 96.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), display3: const TextStyle(deb…
- englishLike2014 → const TextTheme
-
Defines text geometry for ScriptCategory.englishLike scripts, such as
English, French, Russian, etc.
const TextTheme(display4: const TextStyle(debugLabel: 'englishLike display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.alphabetic), display…
- englishLike2018 → const TextTheme
-
Defines text geometry for ScriptCategory.englishLike scripts, such as
English, French, Russian, etc. [...]
const TextTheme(display4: const TextStyle(debugLabel: 'englishLike display4 2018', fontSize: 96.0, fontWeight: FontWeight.w300, textBaseline: TextBaseline.alphabetic, letterSpacing: -1.5), dis…
- tall2014 → const TextTheme
-
Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai.
const TextTheme(display4: const TextStyle(debugLabel: 'tall display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), display3: cons…
- tall2018 → const TextTheme
-
Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai. [...]
const TextTheme(display4: const TextStyle(debugLabel: 'tall display4 2018', fontSize: 96.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), display3: const TextStyle(debug…
- whiteCupertino → const TextTheme
-
A material design text theme with light glyphs based on San Francisco. [...]
const TextTheme(display4: const TextStyle(debugLabel: 'whiteCupertino display4', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none), d…
- whiteMountainView → const TextTheme
-
A material design text theme with light glyphs based on Roboto. [...]
const TextTheme(display4: const TextStyle(debugLabel: 'whiteMountainView display4', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), displa…