TStyle constructor

const TStyle({
  1. double? wordSpacing,
  2. FontType? fontType,
  3. FontWeight? fontWeight,
  4. Color? color = UCS.mainBlack,
  5. double? fontSize = 14,
  6. double? letterSpacing,
  7. double? height,
  8. String? fontFamily,
  9. TextBaseline? textBaseline = TextBaseline.ideographic,
  10. Color? backgroundColor,
  11. bool inherit = true,
  12. List<String>? fontFamilyFallback,
  13. String? package,
  14. Locale? locale,
  15. FontStyle? fontStyle,
  16. Paint? foreground,
  17. Paint? background,
  18. TextDecoration? decoration = TextDecoration.none,
  19. Color? decorationColor,
  20. TextDecorationStyle? decorationStyle,
  21. double? decorationThickness,
  22. String? debugLabel,
  23. List<Shadow>? shadows,
  24. List<FontFeature>? fontFeatures,
  25. List<FontVariation>? fontVariations,
  26. TextLeadingDistribution? leadingDistribution,
  27. TextOverflow? overflow,
})

添加了基础颜色,不适合主题适配

Implementation

const TStyle(
    {double? wordSpacing,
    FontType? fontType,
    FontWeight? fontWeight,
    Color? color = UCS.mainBlack,
    super.fontSize = 14,
    super.letterSpacing,
    super.height,
    super.fontFamily,
    super.textBaseline = TextBaseline.ideographic,
    super.backgroundColor,
    super.inherit = true,
    super.fontFamilyFallback,
    super.package,
    super.locale,
    super.fontStyle,
    super.foreground,
    super.background,

    /// [text]的划线
    /// [TextDecoration.none] 没有 默认
    /// [TextDecoration.underline] 下划线
    /// [TextDecoration.overline] 上划线
    /// [TextDecoration.lineThrough] 中间的线(删除线)
    super.decoration = TextDecoration.none,
    super.decorationColor,
    super.decorationStyle,
    super.decorationThickness,
    super.debugLabel,
    super.shadows,
    super.fontFeatures,
    super.fontVariations,
    super.leadingDistribution,
    super.overflow})
    : super(
          color: color,
          wordSpacing: wordSpacing ?? letterSpacing,
          fontWeight: fontWeight ??
              ((fontType == null || fontType == FontType.normal)
                  ? FontWeight.normal
                  : fontType == FontType.medium
                      ? FontWeight.w500
                      : fontType == FontType.semiBold
                          ? FontWeight.w600
                          : fontType == FontType.bold
                              ? FontWeight.bold
                              : FontWeight.normal));