TextTheme constructor

const TextTheme(
  1. {TextStyle headline1,
  2. TextStyle headline2,
  3. TextStyle headline3,
  4. TextStyle headline4,
  5. TextStyle headline5,
  6. TextStyle headline6,
  7. TextStyle subtitle1,
  8. TextStyle subtitle2,
  9. TextStyle bodyText1,
  10. TextStyle bodyText2,
  11. TextStyle caption,
  12. TextStyle button,
  13. TextStyle overline,
  14. @Deprecated('This is the term used in the 2014 version of material design. The modern term is headline1. ' 'This feature was deprecated after v1.13.8.') TextStyle display4,
  15. @Deprecated('This is the term used in the 2014 version of material design. The modern term is headline2. ' 'This feature was deprecated after v1.13.8.') TextStyle display3,
  16. @Deprecated('This is the term used in the 2014 version of material design. The modern term is headline3. ' 'This feature was deprecated after v1.13.8.') TextStyle display2,
  17. @Deprecated('This is the term used in the 2014 version of material design. The modern term is headline4. ' 'This feature was deprecated after v1.13.8.') TextStyle display1,
  18. @Deprecated('This is the term used in the 2014 version of material design. The modern term is headline5. ' 'This feature was deprecated after v1.13.8.') TextStyle headline,
  19. @Deprecated('This is the term used in the 2014 version of material design. The modern term is headline6. ' 'This feature was deprecated after v1.13.8.') TextStyle title,
  20. @Deprecated('This is the term used in the 2014 version of material design. The modern term is subtitle1. ' 'This feature was deprecated after v1.13.8.') TextStyle subhead,
  21. @Deprecated('This is the term used in the 2014 version of material design. The modern term is subtitle2. ' 'This feature was deprecated after v1.13.8.') TextStyle subtitle,
  22. @Deprecated('This is the term used in the 2014 version of material design. The modern term is bodyText1. ' 'This feature was deprecated after v1.13.8.') TextStyle body2,
  23. @Deprecated('This is the term used in the 2014 version of material design. The modern term is bodyText2. ' 'This feature was deprecated after v1.13.8.') TextStyle body1}
)

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.

Implementation

const TextTheme({
  TextStyle headline1,
  TextStyle headline2,
  TextStyle headline3,
  TextStyle headline4,
  TextStyle headline5,
  TextStyle headline6,
  TextStyle subtitle1,
  TextStyle subtitle2,
  TextStyle bodyText1,
  TextStyle bodyText2,
  this.caption,
  this.button,
  this.overline,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is headline1. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle display4,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is headline2. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle display3,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is headline3. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle display2,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is headline4. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle display1,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is headline5. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle headline,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is headline6. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle title,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is subtitle1. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle subhead,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is subtitle2. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle subtitle,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is bodyText1. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle body2,
  @Deprecated(
    'This is the term used in the 2014 version of material design. The modern term is bodyText2. '
    'This feature was deprecated after v1.13.8.'
  )
  TextStyle body1,
}) : assert(
       (headline1 == null && headline2 == null && headline3 == null && headline4 == null && headline5 == null && headline6 == null &&
        subtitle1 == null && subtitle2 == null &&
        bodyText1 == null && bodyText2 == null) ||
       (display4 == null && display3 == null && display2 == null && display1 == null && headline == null && title == null &&
        subhead == null && subtitle == null &&
        body2 == null && body1 == null), 'Cannot mix 2014 and 2018 terms in call to TextTheme() constructor.'),
     headline1 = headline1 ?? display4,
     headline2 = headline2 ?? display3,
     headline3 = headline3 ?? display2,
     headline4 = headline4 ?? display1,
     headline5 = headline5 ?? headline,
     headline6 = headline6 ?? title,
     subtitle1 = subtitle1 ?? subhead,
     subtitle2 = subtitle2 ?? subtitle,
     bodyText1 = bodyText1 ?? body2,
     bodyText2 = bodyText2 ?? body1;