style static method

TextStyle style({
  1. required double fontSize,
  2. FontWeight? fontWeight,
  3. Color? color,
  4. double? letterSpacing,
  5. double? height,
  6. String? fontFamily,
  7. TextDecoration? decoration,
  8. FontStyle? fontStyle,
  9. 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,
  );
}