headline2 static method

TextStyle headline2(
  1. BuildContext context
)

A text style for the app's headline 2.

The headline 2 text style is used for secondary titles and is typically displayed in a smaller font size than the headline 1.

Implementation

static TextStyle headline2(BuildContext context) => TextStyle(
  // The font size is set to 24sp which is a medium font size.
  fontSize: 24.sp,
  // The font weight is set to w600 which makes the text thicker and more
  // prominent than the normal font weight.
  // fontWeight: FontWeight.w600,
  // The color is set to the onPrimary color of the theme which is the
  // default color for text on the primary color.
  color: Theme.of(context).colorScheme.onPrimary,
);