Deps update - #39
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@ThemeGennow interpolates a nullable field whose type has an instancelerpmethod, instead of falling back tot < 0.5 ? a : b.lerp(a, b, 0)returnsa's value andlerp(a, b, 1)returnsb's value even when the other side is null. Previously a null on theaside either discardedbentirely or was taken at anyt.mergenow 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.lerpormergemethod with a non-nullable parameter is now guarded, instead of generating code that does not compile.lerpormergemethod 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.lerpormergeis now called on the class rather than on an instantiation of it, so a generic field type no longer generatesBox<int>.lerp(...).WidgetStatePropertyfield with a non-nullable generic now reports anInvalidGenerationSourceErrorpointing at the field instead of a bareStateError, and an unrelated generic type with a four parameterlerpis no longer treated as aWidgetStateProperty.Durationis detected by element rather than by name, and a field narrowed by a subclass keeps the narrowed type in the generated code.LerpInfo/MergeInfo,==/hashCodecontract fixed for theLerpInfoclasses, dead code removed (getMixinsNames,BaseClassVisitor, unused builder options and lerp-lookup flag).Closes: #38