In Swift, when the type of a value can be inferred, you can omit it.
E.g.
if (animation.status == AnimationStatus.finished ||
animation.status == AnimationStatus.dismissed) {
…
}
becomes
If (animation.status == .finished ||
animation.status == .dismissed) {
…
}
How come we don’t have this in Dart too?
Is it being worked on for Dart 3.0 maybe?
In Swift, when the type of a value can be inferred, you can omit it.
E.g.
if (animation.status == AnimationStatus.finished ||
animation.status == AnimationStatus.dismissed) {
…
}becomes
If (animation.status == .finished ||
animation.status == .dismissed) {
…
}
class Color {static const red = Color(255, 0, 0);static const green = Color(0, 255, 0);static const blue = Color(0, 0, 255);final int r, g, b;const Color(this.r, this.g, this.b);}