Package selection guidance compiled from public package information, community data, and project usage.
A Dart package providing annotations for the theme_extensions_builder, enabling streamlined creation and management of theme extensions in Flutter applications. It serves as a companion to theme_extensions_builder, offering compile-time code generation support through annotations. This package itself does not contain executable logic but enhances developer productivity by simplifying theme configuration and reducing boilerplate. It is designed to work exclusively with the theme_extensions_builder package.
Use cases
Generating theme extension classes
Simplifying theme configuration
Enabling type-safe theme handling
Reducing boilerplate in theme setup
Supporting dynamic theming workflows
Key features
Compile-time code generation
Integration with theme_extensions_builder
Type-safe theme definitions
Minimal runtime overhead
Annotation-driven development
Suitable for
Flutter developers using theme_extensions_builder
Teams prioritizing maintainable theme systems
Projects requiring scalable theming solutions
Developers seeking reduced boilerplate
Apps with complex or dynamic theme requirements
Considerations
Requires theme_extensions_builder to function
No standalone functionality
Dependent on build_runner for code generation
Limited to use within supported Flutter projects
Not suitable for simple static themes
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
theme_extensions_builder is a powerful code generator for Flutter's ThemeExtension classes. It eliminates boilerplate code by automatically generating copyWith, lerp, ==, and hashCode methods, along with convenient BuildContext extensions for easy theme access.
Custom Components: Buttons, cards, and typography showcases
Best Practices: Real-world organization patterns
🛠️ Development
The repository is a pub workspace: one flutter pub get at the root resolves every package, including the example app.
flutter pub get
scripts/prepare_push.sh # format, analyze, build and test every package
scripts/update_goldens.sh # regenerate the golden files after a generator change
The generator tests run on the Dart SDK alone. The Flutter classes the fixtures use are small stand-ins in packages/theme_extensions_builder/test/fixtures/flutter_stubs.dart, with the same lerp and merge signatures as the real ones. The example app is where the generated code meets the real framework, so CI regenerates and analyzes it on every push.