chroma_theme 1.1.0+3
chroma_theme: ^1.1.0+3 copied to clipboard
A dynamic, adaptive, and highly customizable Material 3 theme management package for Flutter apps, featuring pre-defined palettes and dynamic seed color generation.
Chroma Theme π¨
A premium, dynamic, and adaptive Material 3 theme engine for Flutter. Chroma Theme simplifies complex theme management, providing system-aware modes, custom tonal palettes, and beautiful animated transitions with zero boilerplate.
β¨ Key Features #
- π Intelligent Mode Switching β Support for
Light,Dark,System,High Contrast, and a dedicated AMOLED mode. - π¨ Dynamic Seed Generation β Generate entire ColorSchemes from a single primary color or a complete set of seeds.
- π Predefined Premium Palettes β 20+ professionally curated palettes (e.g.,
Neon Forest,Midnight Mint,Berry Blush). - π Smooth Transitions β Built-in
AnimatedThemesupport for delightful UI state changes. - π οΈ Tonal Palette Access β Direct access to Material 3 tones (0-100) for every color in your scheme.
- π§© Component Overrides β Easily customize specific Material widgets globally without messy
ThemeDatablocks. - π Zero Boilerplate β Intuitive
BuildContextextensions for ultra-fast development.
β Why Chroma Theme? #
Managing Material 3 themes manually requires handling dozens of colors, theme modes, and component styles.
Chroma Theme simplifies this into:
- π¨ One seed color β complete ColorScheme
- π Light, Dark, AMOLED, and High Contrast modes
- π 20+ premium prebuilt palettes
- π§© Global component overrides
- πΎ Persistent theme settings
- π Zero boilerplate API
π¦ Installation #
Add chroma_theme to your pubspec.yaml:
dependencies:
chroma_theme: ^1.1.0
Then run:
flutter pub get
π Quick Start #
Wrap your MaterialApp (or your root widget) with ChromaTheme:
import 'package:chroma_theme/chroma_theme.dart';
import 'package:flutter/material.dart';
void main() {
runApp(
ChromaTheme(
initialMode: ChromaThemeMode.system,
initialPalette: ChromaPalette.blue,
child: const MyApp(),
),
);
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// ChromaTheme automatically handles Theme/DarkTheme for your MaterialApp
return MaterialApp(
title: 'Chroma Demo',
// If child is MaterialApp, ChromaTheme injects theme/darkTheme/themeMode
home: const HomeScreen(),
);
}
}
π οΈ Advanced Usage #
Accessing the Controller #
Toggle themes or change palettes from anywhere using the extension:
final chroma = context.chroma;
// Switch to AMOLED mode
chroma.setTheme(ChromaThemeMode.amoled);
// Use a premium palette
chroma.setPalette(ChromaPalette.neonForest);
Custom Dynamic Seeds #
Want total control? Provide your own seed colors:
chroma.setSeeds(
const ChromaSeeds(
primary: Color(0xFF00A19B),
secondary: Color(0xFFE4DDD3),
neutralLight: Color(0xFFF5F1EA),
),
);
BuildContext Power Tools #
Access colors and text styles instantly:
// Current ColorScheme
final colors = context.chromaColors;
// Current TextTheme
final text = context.chromaText;
// Specific Tonal Palettes (M3)
final primaryTone50 = context.chromaTones.primary[50];
π¨ Predefined Palettes #
Chroma Theme comes with 20+ professionally curated palettes. You can switch between them instantly using context.chroma.setPalette().
πΏ Nature & Earthy #
emerald,mintLatte,neonForest,emeraldRoad,colonialNature
π Ocean & Cool #
blue,oceanSignal,midnightMint,softOcean,colonialWaterloo
π Premium & Rich #
berryBlush,raisinCaramel,royalBerry,noirMauve,softMauve
π¦Ύ Industrial & Dark #
blackMetal,onyxSpring,midnightChrysocolla,khakiSlate,armyCoral
π¦ Minimal & Soft #
mono,iceLatte,uniformPalesun
Note
All palettes are Material 3 compatible and automatically adapt to Light, Dark, and AMOLED modes.
ποΈ Component Overrides #
Clean up your code by defining component styles once at the root:
ChromaTheme(
overrides: ChromaOverrides(
appBarTheme: const AppBarTheme(centerTitle: true, elevation: 0),
cardTheme: CardThemeData(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
),
),
child: const MyApp(),
)
πΎ Persistence #
Implement the ThemePersistence interface to save user preferences (e.g., via shared_preferences or hive).
class MyThemeStorage implements ThemePersistence {
@override
Future<void> save(ChromaThemeSettings settings) async { /* ... */ }
@override
Future<ChromaThemeSettings?> load() async { /* ... */ }
}
π Documentation #
For detailed API breakdowns and advanced guides:
- π API Reference
- π‘ Usage Guide
- π View Full Example on GitHub
π€ Contributing #
Contributions are welcome! Please feel free to submit a Pull Request or open an issue for any bugs or feature requests.
π License #
This project is licensed under the MIT License - see the LICENSE file for details.
π± Screenshots #
| Light | Dark | AMOLED | High Contrast |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
π¨βπ» Author #
Satyam Gawali



