google / google/built_value.dart

Clarify how Enum Classes differ from dart 2.17 enhanced enums with members

Open
#1,171 4 comments 7 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
886
Forks
195
Avg merge
1d 11h
Merged PRs (30d)
4

Description

See annaouncement post from Dart 2.17 which details changes for "Enhanced enums with members": https://medium.com/dartlang/dart-2-17-b216bfc80c5d#:~:text=Enhanced%20enums%20with%20members

The documentation for built_value still mentions:

> For an object oriented design, though, enums need to be classes. Dart falls short here, so Enum Classes provide what's missing!

This remark seems outdated. That said, it does seem that `EnumClass`s are still relevant for serializability (see https://github.com/google/built_value.dart/issues/1147#issuecomment-1127819736).

The documentation should be updated to clarify the feature overlap and why `EnumClass` is still relevant. Furthermore, if dart's implementation could make serializability possible without `EnumClass`, then an issue should be opened in dart-lang itself and one here to track any upstream changes and deprecate `EnumClass`.

Please let me know if I can help with taking ownership of these changes and pushing them forward.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.