Skip to main content

theme_extensions_gen 1.3.0 copy "theme_extensions_gen: ^1.3.0" to clipboard
theme_extensions_gen: ^1.3.0 copied to clipboard

Generate Flutter ThemeExtensions from annotated templates with context accessors and no boilerplate.

Changelog #

1.3.0 #

  • fix: templates with the concise const factory({...}) = _$Name; constructor (Dart 3.13+, what dart fix writes for unnecessary_type_name_in_constructor) failed with a FormatterException; both factory forms work
  • fix: a template whose factory does not redirect fails with a message that names the class instead of generating code that does not compile
  • fix: @ThemeExtensionImpl lists typed List<ThemeExtension<dynamic>> broke the generated list; the getter keeps its List<ThemeExtension> type, so raw and typed implementations both compile
  • fix: templates and implementations outside lib/ (e.g. example/lib) were collected into the generated files and produced asset: imports and invalid getter names
  • fix: generated parts carry // ignore_for_file: type=lint, like the context extensions and theme lists
  • chore: allow build 5 (>=4.0.4 <6.0.0), which build_runner 2.17.1 requires; drop the unused pub_semver dependency; raise dev dependencies (build_runner 2.17.1, build_test 3.5.23, test 1.33, material_ui 1.11.1)
  • chore: the very_good_analysis 11 rule set is written out in analysis_options.yaml with no lint dependency; the package and the example follow it
  • chore(example): package:material_ui imports, concise constructors and dot shorthands
  • ci: Flutter 3.50.0, dart analyze --fatal-infos and dart format checks, current action versions
  • docs: concise factories, typed implementation lists, lib-only collection and dart run build_runner build

1.2.0 #

  • feat: detect the library that provides ThemeExtension (package:flutter/material.dart or package:material_ui/material_ui.dart) from the annotated code and use it in the generated BuildContext extensions and theme lists
  • feat: add the theme_import builder option to set that import explicitly
  • feat: fields without a lerp (int, bool, String, enums, ...) now snap at t = 0.5 instead of producing code that does not compile
  • feat: templates with a second constructor, a generative constructor or positional parameters fail the build with a message that names the class
  • fix: debugFillProperties for bool fields used FlagProperty positionally and did not compile
  • fix: hashCode is built with Object.hashAll instead of XOR, so swapped or equal field values no longer collide
  • fix: the generated theme list carries the same ignore_for_file header as the context extensions and is formatted
  • fix: Diagnosticable detection matched any package whose name starts with flutter
  • fix: same-name templates whose paths nest no longer crash getter name resolution
  • chore: allow analyzer 13 and 14 (>=8.0.0 <15.0.0) and source_gen 4.3
  • chore: very_good_analysis removed from the runtime dependencies
  • chore: .theme_impl.json uses importUri like .theme_templates.json; the old import key is still read
  • test: drop the analyzer-version-specific element mock in favor of noSuchMethod
  • docs: document theme_import, field interpolation rules and template constraints; fix output_groups and builder names in the config examples

1.1.0 #

  • chore: widen analyzer constraint to >=8.0.0 <13.0.0 (support analyzer 10, 11, 12 for Dart 3.10–3.12); generator code unchanged

1.0.1 #

  • chore: allow analyzer 9.0.0

0.3.0 #

  • refactor: migrate to element2 API and remove legacy analyzer usage
  • chore: update dependencies for Dart 3.8 and latest build/codegen packages
  • refactor: drop manual builder config validation in favor of fromMap
  • test: clean up outdated mocks and migrate to TestReaderWriter-based tests
  • test: update golden files for new codegen output

0.2.1 #

  • chore: minor README updates and improved test coverage

0.2.0 #

  • feat: migrate to standalone repository from monorepo

0.1.5 #

  • chore(example): update structure and documentation

0.1.4 #

  • fix: resolve builder integration issues

0.1.3 #

  • chore: update CI config
  • test: improved test coverage and added internal validation tests

0.1.2 #

  • ci: added GitHub Actions
  • docs: improved README and formatting

0.1.1 #

  • feat: added library entrypoint to follow naming conventions
  • docs: improved documentation and score compliance
  • chore: minor cleanup and formatting

0.1.0 #

  • initial release:
  • Code generation for ThemeExtension templates and implementations
  • Support for context extensions and group-based splitting
  • Customizable output via build.yaml