Open
Description
When I need a set options(typically for switch), no run-time type check required, enum in dart is an over-kill, I would use extension type and static const variables instead.
Just like using the same syntax in a class, it is verbose, therefore I expect a feature similar to enum as extension type. Though not having it would be fine, having it would be great.
This is how it would look like right now
extension type const SudoEnum(int i){
static const option1 = SudoEnum(1);
static const option2 = SudoEnum(2);
static const option3 = SudoEnum(3);
}
And this is what I expect it to be
//For the constructor representing underlying structure,
//extension enum is always const,
//I think const keyword should be omitted.
extension enum SudoEnum(int i){
option1(1), option2(2), option3(3);
}