custom static method

TextStyle custom(
  1. BuildContext context, {
  2. required double size,
  3. required double leading,
  4. FontWeight weight = FontWeight.w400,
})

For text sized to the shape it marks, such as a letter in an icon.

Implementation

static TextStyle custom(
  BuildContext context, {
  required double size,
  required double leading,
  FontWeight weight = FontWeight.w400,
}) {
  final theme = Theme.of(context);
  final base = size < title3.size
      ? theme.bodyTextStyle
      : theme.displayTextStyle;
  return base.copyWith(
    fontSize: size,
    height: leading / size,
    fontWeight: weight,
    letterSpacing: 0,
  );
}