themeData property

ThemeData get themeData

Constructed ThemeData using the above tokens

Implementation

static ThemeData get themeData {
  return ThemeData(
    primaryColor: primaryColor,
    scaffoldBackgroundColor: backgroundColor,
    colorScheme: ColorScheme(
      brightness: Brightness.light,
      primary: primaryColor,
      onPrimary: textColorOnPrimary,
      secondary: secondaryColor,
      onSecondary: textColorPrimary,
      background: backgroundColor,
      onBackground: textColorPrimary,
      surface: surfaceColor,
      onSurface: textColorPrimary,
      error: Colors.redAccent,
      onError: Colors.white,
    ),
    fontFamily: fontFamilyBase,  // Set base font family for TextTheme (Flutter uses this for all text styles)
    textTheme: TextTheme(
      displayLarge: TextStyle(fontSize: fontSizeH1, fontWeight: FontWeight.w700, fontFamily: fontFamilyBase, color: textColorPrimary),
      displayMedium: TextStyle(fontSize: fontSizeH2, fontWeight: FontWeight.w700, fontFamily: fontFamilyBase, color: textColorPrimary),
      bodyLarge: TextStyle(fontSize: fontSizeBody, fontWeight: FontWeight.w400, fontFamily: fontFamilyBase, color: textColorPrimary),
      bodyMedium: TextStyle(fontSize: fontSizeSmall, fontWeight: FontWeight.w400, fontFamily: fontFamilyBase, color: textColorSecondary),
      // Other text styles (subtitle, caption, etc.) can be defined similarly...
    ),
  );
}