TStyle.global constructor
TStyle.global({
- Color? color,
- double? fontSize = 14,
- double? letterSpacing,
- double? height,
- String? fontFamily,
- TextBaseline? textBaseline = TextBaseline.ideographic,
- FontType? fontType,
- FontWeight? fontWeight,
- TextDecoration? decoration = TextDecoration.none,
- 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));