TextStyle constructor

const TextStyle(
  1. {bool inherit: true,
  2. Color color,
  3. Color backgroundColor,
  4. double fontSize,
  5. FontWeight fontWeight,
  6. FontStyle fontStyle,
  7. double letterSpacing,
  8. double wordSpacing,
  9. TextBaseline textBaseline,
  10. double height,
  11. Locale locale,
  12. Paint foreground,
  13. Paint background,
  14. List<Shadow> shadows,
  15. List<FontFeature> fontFeatures,
  16. TextDecoration decoration,
  17. Color decorationColor,
  18. TextDecorationStyle decorationStyle,
  19. double decorationThickness,
  20. String debugLabel,
  21. String fontFamily,
  22. List<String> fontFamilyFallback,
  23. String package}
)

Creates a text style.

The package argument must be non-null if the font family is defined in a package. It is combined with the fontFamily argument to set the fontFamily property.

Implementation

const TextStyle({
  this.inherit = true,
  this.color,
  this.backgroundColor,
  this.fontSize,
  this.fontWeight,
  this.fontStyle,
  this.letterSpacing,
  this.wordSpacing,
  this.textBaseline,
  this.height,
  this.locale,
  this.foreground,
  this.background,
  this.shadows,
  this.fontFeatures,
  this.decoration,
  this.decorationColor,
  this.decorationStyle,
  this.decorationThickness,
  this.debugLabel,
  String fontFamily,
  List<String> fontFamilyFallback,
  String package,
}) : fontFamily = package == null ? fontFamily : 'packages/$package/$fontFamily',
     _fontFamilyFallback = fontFamilyFallback,
     _package = package,
     assert(inherit != null),
     assert(color == null || foreground == null, _kColorForegroundWarning),
     assert(backgroundColor == null || background == null, _kColorBackgroundWarning);