This document describes the implementation of the seasonal theme system for ZenTap, allowing users to choose from different color schemes that create unique visual experiences.
lib/utils/theme_manager.dart)lib/utils/theme_notifier.dart)lib/utils/colors.dart)current prefix// Theme selection in settings
_buildSectionHeader(AppLocalizations.of(context)!.appearance),
_buildThemeTile(),
// Theme selection dialog
void _showThemeDialog() {
showDialog(context: context, builder: (context) => _buildThemeDialog());
}
// Instead of: ZenColors.primaryText
// Use: ZenColors.currentPrimaryText (for runtime)
// Or: ZenColors.primaryText (for const contexts)
// Theme-aware widgets
ThemeAwareBuilder(
builder: (context, theme) {
return Container(
color: ZenColors.currentAppBackground,
child: Text(
'Hello',
style: TextStyle(color: ZenColors.currentPrimaryText),
),
);
},
)
The animated background automatically adapts to theme colors:
lib/
├── utils/
│ ├── theme_manager.dart # Core theme management
│ ├── theme_notifier.dart # Reactive theme updates
│ ├── colors.dart # Updated color system
│ └── settings_manager.dart # Theme persistence
├── ui/
│ └── settings_screen.dart # Theme selection UI
└── l10n/
├── app_en.arb # English theme names
├── app_de.arb # German theme names
└── app_hu.arb # Hungarian theme names
{
"appearance": "Appearance",
"colorTheme": "Color Theme",
"colorThemeDesc": "Choose your preferred color scheme",
"selectTheme": "Select Theme",
"defaultTheme": "Default (fSociety)",
"springTheme": "Spring Bloom",
"summerTheme": "Summer Bright",
"autumnTheme": "Autumn Leaves",
"winterTheme": "Winter Frost"
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ThemeAwareBuilder(
builder: (context, theme) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
ZenColors.currentAppBackground,
ZenColors.currentSecondaryBackground,
],
),
),
child: Text(
'Themed Text',
style: TextStyle(color: ZenColors.currentPrimaryText),
),
);
},
);
}
}
// Set theme
await SettingsManager.setSelectedTheme(SeasonalTheme.spring);
// Get current theme
final currentTheme = SettingsManager.selectedTheme;
Widget buildSeasonalIcon() {
final theme = ThemeManager.currentTheme;
return Icon(ThemeManager.getThemeIcon(theme));
}