adaptiveTextStyle static method

TextStyle adaptiveTextStyle(
  1. TextStyle style, {
  2. double? fontSize,
  3. double? height,
  4. double? letterSpacing,
})

Creates responsive text style with adaptive font size

Implementation

static TextStyle adaptiveTextStyle(
  TextStyle style, {
  double? fontSize,
  double? height,
  double? letterSpacing,
}) {
  return style.copyWith(
    fontSize: fontSize != null ? ScreenUtils.adaptiveFontSize(fontSize) : style.fontSize,
    height: height,
    letterSpacing: letterSpacing != null ? ScreenUtils.adaptiveWidth(letterSpacing) : style.letterSpacing,
  );
}