TextTheme constructor

const TextTheme(
  1. {TextStyle? displayLarge,
  2. TextStyle? displayMedium,
  3. TextStyle? displaySmall,
  4. TextStyle? headlineLarge,
  5. TextStyle? headlineMedium,
  6. TextStyle? headlineSmall,
  7. TextStyle? titleLarge,
  8. TextStyle? titleMedium,
  9. TextStyle? titleSmall,
  10. TextStyle? bodyLarge,
  11. TextStyle? bodyMedium,
  12. TextStyle? bodySmall,
  13. TextStyle? labelLarge,
  14. TextStyle? labelMedium,
  15. TextStyle? labelSmall}
)

Creates a text theme that uses the given values.

Rather than creating a new text theme, consider using Typography.black or Typography.white, which implement the typography styles in the Material Design specification:

material.io/design/typography/#type-scale

If you do decide to create your own text theme, consider using one of those predefined themes as a starting point for copyWith or apply.

The 2018 styles cannot be mixed with the 2021 styles. Only one or the other is allowed in this constructor. The 2018 styles are deprecated and will eventually be removed.

Implementation

const TextTheme({
  this.displayLarge,
  this.displayMedium,
  this.displaySmall,
  this.headlineLarge,
  this.headlineMedium,
  this.headlineSmall,
  this.titleLarge,
  this.titleMedium,
  this.titleSmall,
  this.bodyLarge,
  this.bodyMedium,
  this.bodySmall,
  this.labelLarge,
  this.labelMedium,
  this.labelSmall,
});