Skip to content

Instantly share code, notes, and snippets.

Created Dec 4, 2019
What would you like to do?
Dart - sample app
main() {
var myCar = new Car("Cybertruck", new DateTime(2021, 01, 01));
class Car {
String model;
DateTime productionDate;
// Ctor: notice the syntactic sugar members' assignment
Car(this.model, this.productionDate) {
// Some other ctor init code here
int get productionYear =>
void describe() {
print('Car: $model, produced in $productionYear');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment