Skip to content

refactor(freezed): declare freezed classes abstract - #14

Merged
sifferhans merged 1 commit into
mainfrom
feat/freezed-abstract-class-syntax
Sep 8, 2026
Merged

refactor(freezed): declare freezed classes abstract#14
sifferhans merged 1 commit into
mainfrom
feat/freezed-abstract-class-syntax

Conversation

@sifferhans

Copy link
Copy Markdown
Collaborator

Converts all 41 @freezed classes in bccm_core from class X with _$X to abstract class X with _$X.

freezed 3.0.0 made this mandatory — classes must be abstract, sealed, or manually implement _$X — and freezed 4 is required by the codegen cluster (it is the only freezed supporting analyzer 13, which is in turn the only analyzer that parses Dart 3.13). Landing the syntax change on its own keeps it out of that cutover PR.

No regeneration needed: the generated mixin does not depend on the declaration keyword, so the committed .freezed.dart files stay valid. This was verified on freezed 2.5.8 in a clean pure-Dart harness, which matters because codegen currently cannot run on Flutter 3.47 at all.

None of the 41 are unions (each has one public factory, plus fromJson where serialized), so abstract is correct throughout and no class needs sealed. No @unfreezed anywhere, so the freezed 4 removal of final in constructor parameters does not apply.

Verified: bccm_core analyze clean + 68/68 tests; brunstadtv_app 132 issues (unchanged baseline, 0 errors) + 113/113 tests; kids 10 issues, 0 errors.

Converts all 41 `@freezed` classes in bccm_core from
`class X with _$X` to `abstract class X with _$X`.

freezed 3.0.0 made this mandatory — classes must be `abstract`, `sealed`,
or manually implement `_$X` — and freezed 4 is required by the codegen
cluster (it is the only freezed supporting analyzer 13, which is in turn
the only analyzer that parses Dart 3.13). Landing the syntax change on its
own keeps it out of that cutover PR.

No regeneration needed: the generated mixin does not depend on the
declaration keyword, so the committed .freezed.dart files stay valid. This
was verified on freezed 2.5.8 in a clean pure-Dart harness, which matters
because codegen currently cannot run on Flutter 3.47 at all.

None of the 41 are unions (each has one public factory, plus fromJson
where serialized), so `abstract` is correct throughout and no class needs
`sealed`. No @unfreezed anywhere, so the freezed 4 removal of `final` in
constructor parameters does not apply.

Verified: bccm_core analyze clean + 68/68 tests; brunstadtv_app 132 issues
(unchanged baseline, 0 errors) + 113/113 tests; kids 10 issues, 0 errors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sifferhans
sifferhans merged commit b01766a into main Sep 8, 2026
1 check passed
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.

1 participant