Dart 3 is coming around mid-2023 #843
-
According to the announcement, the next major release will bring us few features that are covered by freezed: Sealed classesSee spec Usage: sealed class Shape {
double calculateArea();
}
class Square implements Shape {
final double length;
Square(this.length);
double calculateArea() => length * length;
}
class Circle implements Shape {
final double radius;
...
}
double calculateArea(Shape shape) => switch (shape) {
Square(length: var l) => l * l,
Circle(radius: var r) => math.pi * r * r
}; Macros (static metaprogramming)See spec This supersedes the code generation. Question@rrousselGit giving all that, how do you see the future of |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Once Dart has built-in pattern matching+sealed classes, Freezed will probably slowly fade away. Depending on when metaprogramming is released, I may migrate Freezed to metaprogramming though. As people are unlikely to refactor their Freezed classes into sealed classes in a quick fashion |
Beta Was this translation helpful? Give feedback.
-
Since Dart 3 is currently being previewed on Flutter 3.9.0-1.0.pre.2, I'm wondering if anyone have tried running this package on it? I also assume that freezed is still useful for the following:
|
Beta Was this translation helpful? Give feedback.
-
freezed will continue to provide value, if a bit more limited in scope, in terms of data classes. Kotlin has sealed classes and if/switch expressions and Scala also has pattern matching, but immutable data classes (or case classes in Scala) are still very useful and ubiquitous in both languages My 2c. |
Beta Was this translation helpful? Give feedback.
Once Dart has built-in pattern matching+sealed classes, Freezed will probably slowly fade away.
Depending on when metaprogramming is released, I may migrate Freezed to metaprogramming though. As people are unlikely to refactor their Freezed classes into sealed classes in a quick fashion