Open
Description
Admin comment: this is being implemented, feature specification, dart-lang/sdk#57036, experiment flag dot-shorthands
.
When using enums in Dart, it can become tedious to have to specify the full enum name every time. Since Dart has the ability to infer the type, it would be nice to allow the use of shorter dot syntax in a similar manner to Swift
The current way to use enums:
enum CompassPoint {
north,
south,
east,
west,
}
if (myValue == CompassPoint.north) {
// do something
}
The proposed alternative:
enum CompassPoint {
north,
south,
east,
west,
}
if (myValue == .north) {
// do something
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Being implemented