dart
DESCRIPTION
Short presentation about Dart presented before Code Lab. Code Lab is available on the Github: * https://github.com/Janamou/dart-codelab/ * https://github.com/Janamou/dart-codelab/wikiTRANSCRIPT
Introduction to the
Dart lang
Jana Moudrá | @Janamou | +JanaMoudrá
Open-sourceFor better performance
Easy to learnObject oriented
Modular
Use the Dart language, libraries, and tools to write
anything from simple scripts to full-featured apps.
Source: www.dartlang.org
How?
How?Download Dart
Dart Editor DartiumDart SDK
Dart SDKDart VMLibraries
Command Line Tools
How?Learn the language
How?Learn the language
It is easy!
var x = 10;
var y = 20;
or
num x = 10;
num y = 20;
Optional Types
void main() {
print("Hello world Dart!");
}
main() function
void main() {
querySelector("#my-button")
..text = "Open Window"
..onClick.listen(openWindow);
}
Cascade operator
class Person {
String firstName;
String lastName;
int age;
Person(this.firstName, this.lastName);
}
void main() {
Person person = new Person("Jana", "Moudrá");
}
Syntactic sugar
class Person {
String firstName;
String lastName;
int age;
Person(this.firstName, this.lastName);
Person.withAge(this.lastName, this.age);
}
void main() {
Person person = new Person.withAge("Moudrá", 25);
}
Named constructors
class Person {
String _firstName;
String _lastName;
int _age;
Person(this._firstName, this._lastName);
Person.withAge(this._lastName, this._age);
int get age => _age;
set age(int age) => _age = age;
}
Getter and Setter
How?Develop awesome apps!
Code LabPart...
github.com/Janamou/dart-codelab