this post was submitted on 04 Oct 2023
2 points (75.0% liked)

Flutter

771 readers
6 users here now

Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC

founded 2 years ago
MODERATORS
 

Here's a nice simple article explaining enhanced enums that have been around for a while but may be something overlooked. Between these and sealed classes I think Dart has an excellent story for pattern matching.

you are viewing a single comment's thread
view the rest of the comments
[–] anlumo@feddit.de 1 points 2 years ago (7 children)

I've yet to find a single use case for enhanced enums. It also doesn’t help that freezed doesn’t support them.

[–] Rexios@lemm.ee 1 points 2 years ago (5 children)

How exactly does freezed not support them? All data on an enhanced enum is static.

[–] samus7070@programming.dev 1 points 2 years ago

Maybe the code generator? I have no idea. It seems like there shouldn’t be an issue.

load more comments (4 replies)
load more comments (5 replies)