TStyle constructor
const
TStyle({
- double? wordSpacing,
- FontType? fontType,
- FontWeight? fontWeight,
- Color? color = UCS.mainBlack,
- double? fontSize = 14,
- double? letterSpacing,
- double? height,
- String? fontFamily,
- TextBaseline? textBaseline = TextBaseline.ideographic,
- Color? backgroundColor,
- bool inherit = true,
- List<
String> ? fontFamilyFallback, - String? package,
- Locale? locale,
- FontStyle? fontStyle,
- Paint? foreground,
- Paint? background,
- TextDecoration? decoration = TextDecoration.none,
- Color? decorationColor,
- TextDecorationStyle? decorationStyle,
- double? decorationThickness,
- String? debugLabel,
- List<
Shadow> ? shadows, - List<
FontFeature> ? fontFeatures, - List<
FontVariation> ? fontVariations, - TextLeadingDistribution? leadingDistribution,
- 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));