You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In version 3.+, the when method has been removed, which affects readability and convenience, especially when used in Flutter widgets.
Describe the solution you'd like
Provide an option to generate the when method alongside the new sealed class features. This would allow developers to maintain cleaner and more expressive widget code, particularly when dealing with multiple subclasses.
Describe alternatives you've considered
While pattern matching with switch expressions or map methods works, they tend to be more verbose and less readable in widget trees. The when method offered a more elegant and concise alternative.
Additional context
Loving the new sealed class solution! It brings powerful expressiveness to Dart. However, the when method was still very handy and readable — especially in UI code where clarity matters. An optional generation of when would provide the best of both worlds.
The text was updated successfully, but these errors were encountered:
Please restore 'when' and 'maybe when' in the case of blocks, because in order to transition to v3, it is necessary to migrate hundreds or even thousands of blocks.
My biggest mistake in 2025 was upgrading Freezed to version 3 — the whole codebase is broken. I hope helper functions will be added soon. Many people use BLoC with Freezed, where pattern-matching functions like map and when are crucial.
Is your feature request related to a problem? Please describe.
In version 3.+, the when method has been removed, which affects readability and convenience, especially when used in Flutter widgets.
Describe the solution you'd like
Provide an option to generate the when method alongside the new sealed class features. This would allow developers to maintain cleaner and more expressive widget code, particularly when dealing with multiple subclasses.
Describe alternatives you've considered
While pattern matching with switch expressions or map methods works, they tend to be more verbose and less readable in widget trees. The when method offered a more elegant and concise alternative.
Additional context
Loving the new sealed class solution! It brings powerful expressiveness to Dart. However, the when method was still very handy and readable — especially in UI code where clarity matters. An optional generation of when would provide the best of both worlds.
The text was updated successfully, but these errors were encountered: