mobile-music/lib/theme/app_theme.dart
2026-07-29 22:41:38 -04:00

52 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'tokens.dart';
/// Builds the app [ThemeData] from the Timbre tokens.
///
/// Monospace type is core to the identity — every surface uses JetBrains Mono
/// (a close analog to the terminal fonts in Timbre's screenshots). The [accent]
/// is passed in so the theme rebuilds when album-art extraction changes it.
ThemeData buildTimbreTheme(Color accent) {
final mono = GoogleFonts.jetBrainsMonoTextTheme(
ThemeData.dark().textTheme,
).apply(
bodyColor: TimbreColors.foreground,
displayColor: TimbreColors.foreground,
);
final scheme = ColorScheme.fromSeed(
seedColor: accent,
brightness: Brightness.dark,
surface: TimbreColors.surface,
).copyWith(
primary: accent,
secondary: accent,
onSurface: TimbreColors.foreground,
);
return ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
scaffoldBackgroundColor: TimbreColors.background,
canvasColor: TimbreColors.background,
colorScheme: scheme,
textTheme: mono,
primaryTextTheme: mono,
dividerColor: TimbreColors.border,
splashFactory: NoSplash.splashFactory,
highlightColor: Colors.transparent,
// Keep chrome flat and quiet — the content (and accent) carry the look.
appBarTheme: const AppBarTheme(
backgroundColor: TimbreColors.background,
surfaceTintColor: Colors.transparent,
elevation: 0,
centerTitle: false,
),
listTileTheme: const ListTileThemeData(
dense: true,
minVerticalPadding: TimbreSpacing.sm,
),
);
}