Fully customizable color scheme

This commit is contained in:
2025-10-04 22:12:39 +08:00
parent 31ac5ad07c
commit 1abbd85614
6 changed files with 672 additions and 83 deletions

View File

@@ -31,11 +31,32 @@ ThemeData createAppTheme(Brightness brightness, AppSettings settings) {
? Color(settings.appColorScheme!)
: Colors.indigo;
final colorScheme = ColorScheme.fromSeed(
var colorScheme = ColorScheme.fromSeed(
seedColor: seedColor,
brightness: brightness,
);
final customColors = settings.customColors;
if (customColors != null) {
colorScheme = colorScheme.copyWith(
primary:
customColors.primary != null ? Color(customColors.primary!) : null,
secondary:
customColors.secondary != null
? Color(customColors.secondary!)
: null,
tertiary:
customColors.tertiary != null ? Color(customColors.tertiary!) : null,
surface:
customColors.surface != null ? Color(customColors.surface!) : null,
background:
customColors.background != null
? Color(customColors.background!)
: null,
error: customColors.error != null ? Color(customColors.error!) : null,
);
}
final hasAppBarTransparent = settings.appBarTransparent;
final useM3 = settings.useMaterial3;