Spyke
feddit.de

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

1

Prior to sealed classes, I wished they were more like swift enums that could carry dynamic data and have different associated types per case. Now if I want that, I can do that with a sealed class. It’s still nice to have smarter enums if I need a little extra smarts and want to keep the logic close to the enum.

1
Rexiosreply
lemm.ee

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

1
anlumoreply
feddit.de

Freezed generates sealed classes, not enums.

1
Rexiosreply
lemm.ee

I’m not sure enhanced enums do what you think they do if you expect freezed to generate anything for them besides what json_serializable generates for regular enums

1
anlumoreply
feddit.de

The whole point of the discussion is that enhanced enums don't do anything in practice.

1

Instead of writing verbose extensions and functions all over the place you can use enhanced enums. I mean what else are they supposed to do?

1

You reached the end

Everything you need to know about Enum with Flutter and Dart | Spyke