TStyle.global constructor

TStyle.global({
  1. Color? color,
  2. double? fontSize = 14,
  3. double? letterSpacing,
  4. double? height,
  5. String? fontFamily,
  6. TextBaseline? textBaseline = TextBaseline.ideographic,
  7. FontType? fontType,
  8. FontWeight? fontWeight,
  9. TextDecoration? decoration = TextDecoration.none,
  10. Color? backgroundColor,
})

使用 GlobalConfig().config.textColor?.styleColor 预设颜色,不适合主题适配

Implementation

TStyle.global(
    {Color? color,
    super.fontSize = 14,
    super.letterSpacing,
    super.height,
    super.fontFamily,
    super.textBaseline = TextBaseline.ideographic,
    FontType? fontType,
    FontWeight? fontWeight,
    super.decoration = TextDecoration.none,
    super.backgroundColor})
    : super(
          color: color ?? GlobalConfig().config.textColor?.styleColor,
          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));