Files
oott/frontend/lib/theme/theme_builder.dart
T
rzuastiandClaude Opus 4.8 dce683e396 Add Catppuccin Latte, Dracula, Alucard, Nord and Tokyo Night themes
Add five new selectable themes alongside the existing Catppuccin Mocha
and Gruvbox Dark, each built through the shared buildAppTheme so they
stay visually consistent. Palettes are taken from each project's
official source; a few intermediate surface shades are interpolated
where the canonical palette omits them (noted in the theme files).

Register the new themes in main.dart and add their dropdown entries in
settings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 10:19:56 -04:00

38 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'app_colors.dart';
/// Builds a Material 3 [ThemeData] from a [ColorScheme] and the app's custom
/// [AppColorExtension], applying the shared OOTT typography.
///
/// Every bundled theme (Catppuccin Mocha/Latte, Gruvbox Dark, Dracula, Alucard,
/// Nord, Tokyo Night) goes through here so they stay visually consistent — only
/// their colors differ.
ThemeData buildAppTheme({
required ColorScheme colorScheme,
required AppColorExtension appColors,
}) {
final base = ThemeData(colorScheme: colorScheme, useMaterial3: true);
return base.copyWith(
textTheme: _brandTextTheme(base.textTheme),
extensions: [appColors],
);
}
/// Applies the OOTT brand font (Barlow Condensed) to display, headline and
/// large-title styles while leaving body/label styles on the default face for
/// readability. Sizes and colors from [base] are preserved.
TextTheme _brandTextTheme(TextTheme base) {
final branded = GoogleFonts.barlowCondensedTextTheme(base);
return base.copyWith(
displayLarge: branded.displayLarge,
displayMedium: branded.displayMedium,
displaySmall: branded.displaySmall,
headlineLarge: branded.headlineLarge,
headlineMedium: branded.headlineMedium,
headlineSmall: branded.headlineSmall,
titleLarge: branded.titleLarge,
);
}