Skip to content

Deps update - #39

Merged
pro100andrey merged 10 commits into
mainfrom
deps_update
Sep 6, 2026
Merged

Deps update#39
pro100andrey merged 10 commits into
mainfrom
deps_update

Conversation

@pro100andrey

Copy link
Copy Markdown
Owner
  • Fixed: @ThemeGen now interpolates a nullable field whose type has an instance lerp method, instead of falling back to t < 0.5 ? a : b.
  • Fixed: An interpolation that cannot run on a null now keeps the endpoints: lerp(a, b, 0) returns a's value and lerp(a, b, 1) returns b's value even when the other side is null. Previously a null on the a side either discarded b entirely or was taken at any t.
  • Fixed: merge now keeps the current value when the incoming one is null. The static and instance merge branches disagreed on this; the instance behaviour was the correct one.
  • Fixed: A nullable field whose type has a lerp or merge method with a non-nullable parameter is now guarded, instead of generating code that does not compile.
  • Fixed: A field type declaring an unrelated lerp or merge method no longer fails the build, and is no longer mistaken for a supported one: parameter and return types are checked against the field type, a required named parameter disqualifies the method, and a non-generic method is matched with its type arguments. An unusable method is reported as a build warning.
  • Fixed: A static lerp or merge is now called on the class rather than on an instantiation of it, so a generic field type no longer generates Box<int>.lerp(...).
  • Fixed: A WidgetStateProperty field with a non-nullable generic now reports an InvalidGenerationSourceError pointing at the field instead of a bare StateError, and an unrelated generic type with a four parameter lerp is no longer treated as a WidgetStateProperty.
  • Fixed: Duration is detected by element rather than by name, and a field narrowed by a subclass keeps the narrowed type in the generated code.
  • Updated: Analyzer dependency to ">=13.0.0 <15.0.0" and Dart SDK constraint to ">=3.13.0 <4.0.0".
  • Code Quality: Exhaustive switches over LerpInfo/MergeInfo, ==/hashCode contract fixed for the LerpInfo classes, dead code removed (getMixinsNames, BaseClassVisitor, unused builder options and lerp-lookup flag).

Closes: #38

…tor branches

analyzer: ">=13.0.0 <15.0.0"
sdk: ">=3.13.0 <4.0.0"
… has an instance `lerp` method, instead of falling back to `t < 0.5 ? a : b`.

- **Fixed**: `@ThemeGen` now generates compilable `merge` code for a nullable field whose type has a `merge` method with a non-nullable parameter.
- **Fixed**: A field type declaring an unrelated `lerp` or `merge` method no longer fails the build: an unknown signature falls back to no interpolation / no merge, and optional or named parameters no longer hide a supported signature.
- **Fixed**: A `WidgetStateProperty` field with a non-nullable generic now reports an `InvalidGenerationSourceError` pointing at the field instead of a bare `StateError`.
- **Fixed**: `Duration` is detected by element rather than by name, and a field redeclared by a subclass no longer appears twice in the generated `copyWith`.
- **Code Quality**: Exhaustive switches over `LerpInfo`/`MergeInfo`, `==`/`hashCode` contract fixed for `StaticLerp` and `InstanceLerp`, dead code removed (`getMixinsNames`, `BaseClassVisitor`, unused builder options and lerp-lookup flag).
…ndpoints: `lerp(a, b, 0)` returns `a`'s value and `lerp(a, b, 1)` returns `b`'s value even when the other side is null. Previously a null on the `a` side either discarded `b` entirely or was taken at any `t`.
…rkspace

Generator
- Check the annotated class before generating: a missing constructor, a
  field without a named constructor parameter, a @ThemeExtensions class
  that does not extend ThemeExtension<Self>, and a contextAccessorName
  that is not an identifier now stop the build with an
  InvalidGenerationSourceError naming the class and the fix.
- Decide `const` by the constructor named in `constructor:` rather than
  by any constructor of the class; treat `constructor: ''` as unnamed.
- Match @ThemeGen and @ignore by package as well as by name.

Code
- Generate `lerp` and `copyWith` once, in generator/common.dart, for
  both generators. Output is unchanged.
- Trim the symbol model to what the code builders read: drop
  ParameterInfo, lerp args, isStatic, filteredFields, FieldsVisitorConfig
  and the Ref extension type. Skip static fields in the visitor.
- Split analysis.dart into per-method lookups, a DartType extension and
  field_symbol.dart. Drop the meta and collection dependencies.

Tests
- Fixtures for every new error, for ThemeGen and ThemeExtensions.
- EmptyThemeNonConst was declared const; make it non-const and update
  its golden.
- Replace the mock.dart symlinks with a flutter_stubs package.

Repository
- Turn the repository into a pub workspace with the example as a member;
  remove both pubspec_overrides.yaml.
- CI: latest and lowest dependency matrix, analyze with --fatal-infos,
  regenerate fixtures and example and fail on stale .g.theme.dart,
  analyze the example against the real framework.
- prepare_push.sh called the non-existent `dart pub update`; resolve the
  workspace once instead. Fix the cwd in .vscode/tasks.json.

Docs
- README: accurate build.yaml section, limitations, generation errors.
  troubleshooting.md lists each new message. CHANGELOG 7.5.0 extended.
…rkspace

Generator
- Check the annotated class before generating: a missing constructor, a
  field without a named constructor parameter, a @ThemeExtensions class
  that does not extend ThemeExtension<Self>, and a contextAccessorName
  that is not an identifier now stop the build with an
  InvalidGenerationSourceError naming the class and the fix.
- Decide `const` by the constructor named in `constructor:` rather than
  by any constructor of the class; treat `constructor: ''` as unnamed.
- Match @ThemeGen and @ignore by package as well as by name.

Code
- Generate `lerp` and `copyWith` once, in generator/common.dart, for
  both generators. Output is unchanged.
- Trim the symbol model to what the code builders read: drop
  ParameterInfo, lerp args, isStatic, filteredFields, FieldsVisitorConfig
  and the Ref extension type. Skip static fields in the visitor.
- Split analysis.dart into per-method lookups, a DartType extension and
  field_symbol.dart. Drop the meta and collection dependencies.

Tests
- Fixtures for every new error, for ThemeGen and ThemeExtensions.
- EmptyThemeNonConst was declared const; make it non-const and update
  its golden.
- Merge test/theme_gen, test/theme_extensions and test/invalid into
  test/fixtures, next to a single flutter_stubs.dart, replacing the
  mock.dart symlinks and the duplicated helper fixtures.

Packaging
- Drop the `platforms` key: a build_runner generator runs in the build
  process, and claiming web cost the package its WASM sco
- Add example/example.md to the annotation package.

Repository
- Turn the repository into a pub workspace with the examp
  remove both pubspec_overrides.yaml.
- CI: latest and lowest dependency matrix, analyze with --fatal-infos,
  regenerate fixtures and example and fail on stale .g.th
  analyze the example against the real framework.
- prepare_push.sh called the non-existent `dart pub updat
  workspace once instead. Fix the cwd in .vscode/tasks.js

Docs
- README: accurate build.yaml section, limitations, gener
  troubleshooting.md lists each new message. CHANGELOG 7.5.0 extended.
…make CI exercise what it claims

Generator:
- null check an instance lerp with an optional result on a non-nullable field
- substitute the type arguments into fields inherited from a generic superclass
- resolve merge for @ThemeGen fields by lookup first, so a subclass of an
  annotated class merges the same way on clean and incremental builds and a
  hand-written merge is used as declared
- fall back instead of throwing for a nested WidgetStateProperty, and name
  the missing static lerp in the warning instead of an "unsupported signature"
- match the annotations by package (inPackage) as the changelog already said

Validation: required parameters the generated code cannot pass, generic
classes, a missing `with _$X` (read from the parsed declaration, as the
mixin may not exist yet), fields named after mixin members, and reserved
words in contextAccessorName.

CI and packaging: the lowest leg pins analyzer 13.1.0 and source_gen 4.2.3
through dependency_overrides (targeted `pub downgrade` is a no-op at the
workspace root); the generated-files gate sees untracked files; the example
is published without its workspace-only files. Analyzer floor raised to
13.1.0, the lowest the test tooling compiles against.
@pro100andrey
pro100andrey merged commit 36a3671 into main Sep 6, 2026
3 checks passed
@pro100andrey
pro100andrey deleted the deps_update branch September 6, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: again theme_extensions_builder conflicts with analyzer upgrade

1 participant