AppStyles extension

Extension to provide responsive text styles and scaled sizing for different screen widths.

It uses GoogleFonts.poppins as the base font and scales sizes depending on device width:

  • width ≥ 1024 → scale 1.6
  • width ≥ 768 → scale 1.35
  • width < 768 → scale 1.0
on

Properties

accentButton TextStyle

Available on BuildContext, provided by the AppStyles extension

Accent-colored button style (scaled 18px, bold).
no setter
bodyBoldExtraLarge TextStyle

Available on BuildContext, provided by the AppStyles extension

Bold extra large body text (scaled 18px).
no setter
bodyBoldLarge TextStyle

Available on BuildContext, provided by the AppStyles extension

Bold large body text (scaled 16px).
no setter
bodyBoldMedium TextStyle

Available on BuildContext, provided by the AppStyles extension

Bold medium body text (scaled 14px).
no setter
bodyBoldSmall TextStyle

Available on BuildContext, provided by the AppStyles extension

Bold small body text (scaled 12px).
no setter
bodyExtraLarge TextStyle

Available on BuildContext, provided by the AppStyles extension

Extra large body text (scaled 18px).
no setter
bodyLarge TextStyle

Available on BuildContext, provided by the AppStyles extension

Large body text (scaled 16px).
no setter
bodyMedium TextStyle

Available on BuildContext, provided by the AppStyles extension

Medium body text (scaled 14px).
no setter
bodyMediumExtraLarge TextStyle

Available on BuildContext, provided by the AppStyles extension

Medium extra large body text (scaled 18px).
no setter
bodyMediumLarge TextStyle

Available on BuildContext, provided by the AppStyles extension

Medium large body text (scaled 16px).
no setter
bodySmall TextStyle

Available on BuildContext, provided by the AppStyles extension

Small body text (scaled 12px).
no setter
button TextStyle

Available on BuildContext, provided by the AppStyles extension

Default button text style (scaled 18px, bold).
no setter
caption TextStyle

Available on BuildContext, provided by the AppStyles extension

Caption or hint text (scaled 10px).
no setter
headline1 TextStyle

Available on BuildContext, provided by the AppStyles extension

Very large bold headline (scaled 52px).
no setter
headline2 TextStyle

Available on BuildContext, provided by the AppStyles extension

Large bold headline (scaled 36px).
no setter
headline3 TextStyle

Available on BuildContext, provided by the AppStyles extension

Medium bold headline (scaled 28px).
no setter
headline4 TextStyle

Available on BuildContext, provided by the AppStyles extension

Sub-heading style (scaled 24px).
no setter
headline5 TextStyle

Available on BuildContext, provided by the AppStyles extension

Minor heading or section title (scaled 20px).
no setter

Methods

baseTextStyle(double fontSize, {FontWeight fontWeight = FontWeight.normal, double lineHeight = 1.2, Color? color}) TextStyle

Available on BuildContext, provided by the AppStyles extension

Builds the base TextStyle using GoogleFonts.poppins.
scale(double size) double

Available on BuildContext, provided by the AppStyles extension

Scales a given size based on screen width.
scaleBoth(double size) double

Available on BuildContext, provided by the AppStyles extension