Orientação gerada a partir de informações públicas. Apenas para referência.
Um pacote Dart que fornece anotações para o theme_extensions_builder, permitindo a criação e gerenciamento simplificados de extensões de tema em aplicativos Flutter. Serve como companheiro do theme_extensions_builder, oferecendo suporte à geração de código em tempo de compilação por meio de anotações. Este pacote não contém lógica executável, mas melhora a produtividade do desenvolvedor ao simplificar a configuração de temas e reduzir o código repetitivo. É projetado exclusivamente para funcionar com o pacote theme_extensions_builder.
Casos de uso
Gerando classes de extensão de tema
Simplificando a configuração do tema
Habilitar manipulação de temas segura por tipo
Reduzindo o código repetitivo na configuração do tema
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.