AppTypography class

A ThemeExtension that exposes the design system's typography scale.

Provides all 15 Material TextTheme roles as individual TextStyle fields, registered in ThemeData.extensions for both light and dark themes — matching Spacing and CornerRadius's pattern.

Uses two typefaces across all roles:

  • Playfair Display — display, headline, and title roles.
  • Nunito — label and body roles.

Access via ThemeData using the ThemeExtras.appTypography extension, or pass toTextTheme to ThemeData.textTheme when constructing the app theme.

Do not instantiate this class directly in widget code. Always read it through Theme.of(context) (or context.theme) so that theme overrides and lerp animations are respected.

Inheritance

Constructors

AppTypography({required TextStyle? displayLarge, required TextStyle? displayMedium, required TextStyle? displaySmall, required TextStyle? headlineLarge, required TextStyle? headlineMedium, required TextStyle? headlineSmall, required TextStyle? titleLarge, required TextStyle? titleMedium, required TextStyle? titleSmall, required TextStyle? bodyLarge, required TextStyle? bodyMedium, required TextStyle? bodySmall, required TextStyle? labelLarge, required TextStyle? labelMedium, required TextStyle? labelSmall})
const
AppTypography.dark()
The dark-theme typography scale.
factory
AppTypography.light()
The light-theme typography scale.
factory

Properties

bodyLarge TextStyle?
final
bodyMedium TextStyle?
final
bodySmall TextStyle?
final
displayLarge TextStyle?
final
displayMedium TextStyle?
final
displaySmall TextStyle?
final
hashCode int
The hash code for this object.
no setterinherited
headlineLarge TextStyle?
final
headlineMedium TextStyle?
final
headlineSmall TextStyle?
final
labelLarge TextStyle?
final
labelMedium TextStyle?
final
labelSmall TextStyle?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
titleLarge TextStyle?
final
titleMedium TextStyle?
final
titleSmall TextStyle?
final
type Object
The extension's type.
no setterinherited

Methods

copyWith({TextStyle? displayLarge, TextStyle? displayMedium, TextStyle? displaySmall, TextStyle? headlineLarge, TextStyle? headlineMedium, TextStyle? headlineSmall, TextStyle? titleLarge, TextStyle? titleMedium, TextStyle? titleSmall, TextStyle? bodyLarge, TextStyle? bodyMedium, TextStyle? bodySmall, TextStyle? labelLarge, TextStyle? labelMedium, TextStyle? labelSmall}) AppTypography
Creates a copy of this typography scale with the given roles replaced.
override
lerp(covariant ThemeExtension<AppTypography>? other, double t) AppTypography
Linearly interpolates between this scale and other by factor t.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
toTextTheme() TextTheme
Assembles this scale into a plain Material TextTheme, for ThemeData.textTheme.

Operators

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