New: your coding agent can read the release notes before it upgrades. Set up the MCP server →
Theme management package for Flutter with light and dark mode support.
Last release 2 months ago
19 Jun 2026
Release timing varies
gaps range from 2 weeks to 8 months
Rarely documented
notes for 1 of 9 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
9 releases · first in 2024
One column per month.
BREAKING: BestThemeBuilder is now deprecated in favor of direct context access
static const fields inside your class.vars from Annotation: You no longer need to pass a string list of variables to @BestTheme(vars: [...]).ThemeExtension factories (.light() and .dark()) no longer accept a runtime List<BestColor>, switching entirely to zero-argument compile-time constant references.BestTextStyle Typography Tokens: Added native support for handling custom light/dark text style transitions seamlessly.BestAsset Variation Tokens: Added native support for tracking dynamic light/dark image asset paths straight through the context layer.storage property via the BestThemeStorage abstract class interface to handle automated local caching (e.g., via shared_preferences) out of the box.buildLightTheme / buildDarkTheme), preventing accidental data layer loss.If you are updating from v2.x to v3.x, update your declaration file:
Old (v2.0.0):
@BestTheme(vars: ['color1', 'color2'], extensionName: 'myColors')
class MyTheme extends _$MyTheme {
MyTheme() : super(myColors: dataColor);
}
## [2.0.0] - 2026-03-06
### Breaking Changes
- **`BestColor`** is the only remaining export from this package. All theme generation logic
has moved to `best_theme_generator` and `best_theme_annotation`.
- Removed `ThemeParam`, `BestThemeProvider`, and all singleton-related classes that were
previously bundled with this package.
### Changed
- Package is now a minimal peer dependency — it only provides `BestColor` for defining
light/dark color pairs used in the annotation and generator.
- All theme management, `ThemeExtension` generation, `${ClassName}Material` widget, and
`BuildContext` extensions are fully generated by `best_theme_generator 2.0.0`.
## [1.0.1]
### Changed
- Improve documentation
## [1.0.0]
### Added
- Updated main package with improved dependency management
- Enhanced compatibility with Dart 3.x and Flutter 3.x
- Optimized internal structure for better code generation
### Improved
- Cleaned up pubspec.yaml
- Simplified developer experience and setup
- Improved stability and performance for theme management
## [0.0.4] - 2025-9-9
### Added
- **Context-based Access**: Complete redesign with BuildContext extensions for seamless theme management
- **Enhanced Code Generation**: Beautiful header with emojis and improved documentation in generated code
- **Direct Color Access**: Access colors directly via `context.myColors.[colorName]` without wrapper widgets
- **Simplified Theme Control**: Theme management through context extensions (`context.toggleTheme()`, `context.toDarkTheme()`, etc.)
- **Singleton Pattern**: Implemented singleton pattern with `init()` method for better memory management
- **Static Color Getters**: Added static getter methods for each color variable
- **Type Safety**: Improved type safety with better null handling and assertions
- **Performance Optimization**: Eliminated need for `BestThemeBuilder` wrapper, reducing widget tree complexity
### Changed
- **BREAKING**: Replaced object-based approach with context extensions
- **BREAKING**: `BestThemeBuilder` is now deprecated in favor of direct context access
- **API Redesign**: Simplified API from `myTheme.toggle()` to `context.toggleTheme()`
- **Generated Code Structure**: Improved generated code organization and readability
- **Initialization Process**: Changed from manual object creation to automatic singleton initialization
- **Documentation**: Enhanced inline documentation and code comments
### Improved
- **Developer Experience**: Significantly simplified usage patterns
- **Code Generation**: Added beautiful header with generation timestamp and developer credits
- **Error Handling**: Better error messages and assertions for debugging
- **Memory Management**: More efficient memory usage with singleton pattern
- **Performance**: Reduced widget rebuilds and improved theme switching speed
### Deprecated
- ⚠️ `BestThemeBuilder` widget (use direct context access instead)
- ⚠️ Manual theme object creation (automatic initialization via context now)
### Migration Guide
- **Old**: Create theme object → Use `BestThemeBuilder` → Access via `theme.colorName`
- **New**: Use `context.BestTheme()` → Access directly via `context.myColors.colorName`
- **Theme Control**: `myTheme.toggle()` → `context.toggleTheme()`
- **State Check**: `myTheme.isDark` → `context.isDark`
## [0.0.3] - 2025-1-19
### added
- Added custom colors to main class
- Support latest analyzer
## [0.0.2] - 2024-12-29
### Added
- Support go router
## [0.0.1] - 2024-12-26
### Added
- Initial release of `best_theme` package.
- Support for easy theme management with custom colors.
- Dark and light mode toggling functionality.
- System, Light, and Dark theme modes.
- `BestColor` support for defining color variables.
- Annotation-based color generation with `@BestTheme`.
- Context-based short methods for `primary`, `scaffoldBackgroundColor`, `cardColor`, and more.
- `toggle()` method for theme switching and additional methods like `toLight()`, `toDark()`, and `toSystem()`.
### Fixed
- N/A (First release)
### Changed
- N/A (First release)
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →