freezed
freezed copied to clipboard
Code generation for immutable classes that has a simple syntax/API without compromising on the features.
**Describe the bug** _Continuation of #807_ When using a non-nullable (ie. its type bound forces it to be non-nullable) type parameter, but then marking a field of this type nullable,...
We could have: ``` dart run freezed migrate ``` And for the given Freezed class: ```dart @freezed sealed class Example with _$Example { factory Example.data(int data) = ExampleData; factory Example.error(Object...
Related to https://github.com/rrousselGit/freezed/issues/924 In a "Freezed 3.0" version, we could disable "when" by default (and enable its generation through build.yaml).
**Describe the bug** Freezed can't generate class with records. **To Reproduce** What is currently working: ``` @freezed class DTO with _$DTO { const factory DTO({ int? id, required NestedDTO nested,...
**Describe the bug** If you create a value of type `List` in State, and write it as shown in the attached image 1, there will be no errors when you...
**Is your feature request related to a problem? Please describe.** We are currently in the process of publishing a library that uses freezed to generate it's data model. Naturally we...
Related to https://github.com/rrousselGit/freezed/issues/744 That error exists only due to limitations regarding `when`. If pattern-matching generation is disabled, we could do away with this error.
Now that Dart 3 is here, those "when" functions are a bit redundant. Let's remove thousands of lines of code from the generated code.
In that case it works only if fromJson is an arrow function: ```dart import 'package:freezed_annotation/freezed_annotation.dart'; part 'data.freezed.dart'; part 'data.g.dart'; @Freezed(genericArgumentFactories: true) class Data with _$Data { const factory Data({ required...
```dart @freezed class A with _$A { factory A() = AImpl; } @freezed class B with _$B { factory B(AImpl a) = _B; } ``` This is especially useful for...