Get your
own
website
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
enum Coffee { espresso('Espresso', 2.5), latte('Latte', 3.8), cappuccino('Cappuccino', 3.5); final String label; final double price; const Coffee(this.label, this.price); bool get isCheap => price < 3; } void main() { for (var coffee in Coffee.values) { print('${coffee.label}: \$${coffee.price}, cheap: ${coffee.isCheap}'); } }
Espresso: $2.5, cheap: true
Latte: $3.8, cheap: false
Cappuccino: $3.5, cheap: false