The document discusses the Dart programming language. It provides an overview of Dart, including that it is easy to learn, has great tools like Dartium and the Dart SDK, and can be used to write both client and server code. It also gives examples of Dart syntax like classes, constructors, getters/setters, and using the dart:js library to interact with JavaScript.
25. class Animal {
int numberOfLegs;
int numberOfHeads;
Animal(int numberOfLegs, int numberOfHeads) {
this.numberOfLegs = numberOfLegs;
this.numberOfHeads = numberOfHeads;
}
}
Syntactic sugar
26. class Animal {
int numberOfLegs;
int numberOfHeads;
Animal(this.numberOfLegs, this.numberOfHeads);
}
Syntactic sugar
27. class Animal {
int numberOfLegs;
int numberOfHeads;
Animal(this.numberOfLegs, this.numberOfHeads);
}
void main() {
Animal dragon = new Animal(4, 1);
}
Syntactic sugar
28. class Animal {
int numberOfLegs;
int numberOfHeads;
String name;
Animal(this.numberOfLegs, this.numberOfHeads);
Animal.withName(this.name);
}
void main() {
Animal dragon = new Animal.withName("Pepa");
}
Named constructors
29. class Animal {
int numberOfLegs;
int numberOfHeads;
String _name;
Animal(this.numberOfLegs, this.numberOfHeads);
Animal.withName(this._name);
String get name => "$_name is the best";
set name(String name) => _name = name;
}
Getter and Setter
40. pubspec.yaml
name: todolist
description: "My TODO list!"
dependencies:
browser: any
polymer: any
vector_math: any
41. Libraries on Pub
polymer, angular, route,
route_hierarchical,
googleapis, chrome,
json_object, vector_math,
appengine, ...
and more on pub.dartlang.org!