Skip to content

Instantly share code, notes, and snippets.

@samisnotinsane
Created May 9, 2020 17:15
Show Gist options
  • Save samisnotinsane/93fac4c3dd5ed293e720324f40f66796 to your computer and use it in GitHub Desktop.
Save samisnotinsane/93fac4c3dd5ed293e720324f40f66796 to your computer and use it in GitHub Desktop.
Constructors in Dart
void main() {
Human jenny = Human(height: 145, weight: 47);
print(jenny.height);
print(jenny.weight);
Human sam = Human(height: 166, weight: 71);
print(sam.height);
print(sam.weight);
}
class Human {
double height;
double weight;
Human({this.height, this.weight});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment