style static method
TextStyle
style({
- required double fontSize,
- FontWeight? fontWeight,
- Color? color,
- double? letterSpacing,
- double? height,
- String? fontFamily,
- TextDecoration? decoration,
- FontStyle? fontStyle,
- bool allowFontScaling = false,
Get responsive TextStyle
fontSize - Base font size from design
fontWeight - Font weight
color - Text color
letterSpacing - Letter spacing
height - Line height multiplier
allowFontScaling - Whether to respect system font scaling
Implementation
static TextStyle style({
required double fontSize,
FontWeight? fontWeight,
Color? color,
double? letterSpacing,
double? height,
String? fontFamily,
TextDecoration? decoration,
FontStyle? fontStyle,
bool allowFontScaling = false,
}) {
return TextStyle(
fontSize: ScreenUtil.instance.setSp(fontSize, allowFontScaling: allowFontScaling),
fontWeight: fontWeight,
color: color,
letterSpacing: letterSpacing,
height: height,
fontFamily: fontFamily,
decoration: decoration,
fontStyle: fontStyle,
);
}