diff --git a/flutter_client/lib/theme/theme_data.dart b/flutter_client/lib/theme/theme_data.dart index 3b13b8c6..506d5809 100644 --- a/flutter_client/lib/theme/theme_data.dart +++ b/flutter_client/lib/theme/theme_data.dart @@ -4,8 +4,8 @@ import 'package:google_fonts/google_fonts.dart'; import 'theme_extension.dart'; import 'tokens.dart'; -ThemeData buildThemeData() { - final fs = FabledSwordTheme.fromTokens(); +ThemeData buildDarkTheme() { + final fs = FabledSwordTheme.dark(); final colorScheme = ColorScheme.dark( surface: fs.iron, onSurface: fs.parchment, @@ -14,16 +14,45 @@ ThemeData buildThemeData() { secondary: fs.moss, error: fs.error, ); - return ThemeData( useMaterial3: true, + brightness: Brightness.dark, colorScheme: colorScheme, scaffoldBackgroundColor: fs.obsidian, textTheme: GoogleFonts.interTextTheme().apply( bodyColor: fs.parchment, displayColor: fs.parchment, ), - fontFamily: FabledSwordTokens.fontBody, + fontFamily: FabledSwordFlatTokens.fontBody, extensions: >[fs], ); } + +ThemeData buildLightTheme() { + final fs = FabledSwordTheme.light(); + final colorScheme = ColorScheme.light( + surface: fs.iron, + onSurface: fs.parchment, // semantic — light's "parchment" is dark text + primary: fs.accent, + onPrimary: FabledSwordFlatTokens.onAction, + secondary: fs.moss, + error: fs.error, + ); + return ThemeData( + useMaterial3: true, + brightness: Brightness.light, + colorScheme: colorScheme, + scaffoldBackgroundColor: fs.obsidian, // semantic — light's obsidian is the bg + textTheme: GoogleFonts.interTextTheme().apply( + bodyColor: fs.parchment, + displayColor: fs.parchment, + ), + fontFamily: FabledSwordFlatTokens.fontBody, + extensions: >[fs], + ); +} + +/// Back-compat alias. Existing tests + code call buildThemeData(); it +/// returns the dark theme to preserve current behaviour. New code +/// should prefer buildDarkTheme()/buildLightTheme() explicitly. +ThemeData buildThemeData() => buildDarkTheme();