toTextStyle method
转换为 TextStyle
Implementation
TextStyle toTextStyle({
Color? defaultColor,
Color? Function(BuildContext)? colorResolver,
}) {
Color? finalColor = color;
if (finalColor == null && colorResolver != null) {
// 如果提供了颜色解析器,可以在这里使用
// 但需要 BuildContext,所以这里先返回 null
}
finalColor ??= defaultColor;
return TextStyle(
fontSize: fontSize,
fontWeight: fontWeight,
color: finalColor,
fontStyle: fontStyle,
letterSpacing: letterSpacing,
height: height,
);
}