Created
August 7, 2019 21:38
-
-
Save thekarel/8873493a7f7e16259e736920c3e3257b to your computer and use it in GitHub Desktop.
Dart constructor arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final food = Food('good', price: 3); | |
print('${food.taste} ${food.price.toString()}'); | |
} | |
class Food { | |
Food(this.taste, {this.price}); | |
final String taste; | |
final int price; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment