Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Introduction to the
Dart lang
Jana Moudrá
Co-Founder at Juicymo
Organizer at GDG ČVUT Prague/GDG Prague
Interested in Web, Android, Design, Dart
about.me/janamou
Ab...
about.me/janamou
about.me/janamou
1.3.6
Open-source
Language for the Web
For better performance
Goals to replace JavaScript
Ready for standardization
about.me/jan...
Dartium: Chromium with Dart VM
about.me/janamou
Compiled into JavaScript works
in all modern browsers
about.me/janamou
Object Oriented Easy to learn Optional types
Modular
Compiles to
JavaScript
about.me/janamou
Client Server
about.me/janamou
Performance
Dart Performance
www.dartlang.org/performance/
Language
Optional types
Every variable
is object
Top level main()
function
Checked and
Production
modes
Syntactic sugar
Named
const...
var x = 10;
var y = 20;
or
num x = 10;
num y = 20;
Optional types
about.me/janamou
void main() {
print("Hello world Dart!");
}
Top level main()
function
about.me/janamou
class Person {
String firstName;
String lastName;
int age;
Person(this.firstName, this.lastName);
}
void main() {
Person p...
class Person {
String firstName;
String lastName;
int age;
Person(this.firstName, this.lastName);
Person.withAge(this.last...
class Person {
String _firstName;
String _lastName;
int _age;
Person(this.firstName, this.lastName);
Person.withAge(this.l...
void main() {
querySelector("#my-button")
..text = "Open Window"
..onClick.listen(openWindow);
}
Cascade operator
about.me...
someFunc()
.then(printValue)
.catchError(printError);
Futures I.
about.me/janamou
HttpRequest.getString('shapes.json')
.then((String jsonString) {
print(jsonString);
})
.catchError((Error error) {
print(e...
Tools
about.me/janamou
Dart Editor Dartium Dart SDK
Dart Editor
Dart VM
Libraries
Command Line Tools
Dart SDK
Dart VM
Libraries
Command Line Tools
Dart SDK
dart2js dartanalyzer pubdocgen
Libraries
dart:core
dart:html
dart:math
dart:convert
dart:js
dart:web_gl
… and more on https://api.dartlang.org/apidocs/
about.me/ja...
import 'dart:html';
ButtonElement myButton;
void main() {
myButton = querySelector('#myButton');
myButton.onClick.listen(u...
dart:convert
about.me/janamou
import 'dart:convert';
void main() {
String jsonString =
'{"name": "Jana", "surname": "Moudr...
dart:js
about.me/janamou
<script type="text/javascript">
var Person = function(name, surname) {
this.name = name;
this.sur...
dart:js
about.me/janamou
import 'dart:js';
void main() {
var person = new JsObject(context['Person'],
["Jana", "Moudra"]);...
AngularDart
Polymer.dart
StageXL
three.dart
vector_math
… and more on https://pub.dartlang.org/
about.me/janamou
How to start?
How to start?
www.dartlang.org
GET STARTED
www.dartlang.org/codelabs/darrrt/
DOCS > TUTORIALS
www.dartlang.org/docs/tutorials/
DART API REFERENCE
https://api.dartlang.org/apidocs/
DOCS > DART: UP AND RUNNING
www.dartlang.org/docs/dart-up-and-running/
DOCS > API REFERENCE
https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/home
PUB
https://pub.dartlang.org/
SAMPLES
www.dartlang.org/samples/
Thank You!
and happy Dart coding :-)
about.me/janamou
https://www.dartlang.org/
http://news.dartlang.org/
https://pub.dartlang.org/
https://github.com/dart-lang
https://plus.go...
Introduction to the Dart language
Introduction to the Dart language
Upcoming SlideShare
Loading in …5
×

Introduction to the Dart language

2,559 views

Published on

My presentation from event: Introduction to the Dart language organized by GDG SSPŠ.

Published in: Technology

Introduction to the Dart language

  1. 1. Introduction to the Dart lang Jana Moudrá
  2. 2. Co-Founder at Juicymo Organizer at GDG ČVUT Prague/GDG Prague Interested in Web, Android, Design, Dart about.me/janamou About Me
  3. 3. about.me/janamou
  4. 4. about.me/janamou 1.3.6
  5. 5. Open-source Language for the Web For better performance Goals to replace JavaScript Ready for standardization about.me/janamou
  6. 6. Dartium: Chromium with Dart VM about.me/janamou
  7. 7. Compiled into JavaScript works in all modern browsers about.me/janamou
  8. 8. Object Oriented Easy to learn Optional types Modular Compiles to JavaScript about.me/janamou
  9. 9. Client Server about.me/janamou
  10. 10. Performance
  11. 11. Dart Performance www.dartlang.org/performance/
  12. 12. Language
  13. 13. Optional types Every variable is object Top level main() function Checked and Production modes Syntactic sugar Named constructors … and more about.me/janamou Streams Futures HTML
  14. 14. var x = 10; var y = 20; or num x = 10; num y = 20; Optional types about.me/janamou
  15. 15. void main() { print("Hello world Dart!"); } Top level main() function about.me/janamou
  16. 16. class Person { String firstName; String lastName; int age; Person(this.firstName, this.lastName); } void main() { Person person = new Person("Jana", "Moudrá"); } Syntactic sugar about.me/janamou
  17. 17. 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 constructor about.me/janamou
  18. 18. 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/Setter about.me/janamou
  19. 19. void main() { querySelector("#my-button") ..text = "Open Window" ..onClick.listen(openWindow); } Cascade operator about.me/janamou
  20. 20. someFunc() .then(printValue) .catchError(printError); Futures I. about.me/janamou
  21. 21. HttpRequest.getString('shapes.json') .then((String jsonString) { print(jsonString); }) .catchError((Error error) { print(error.toString()); }); Futures II. about.me/janamou
  22. 22. Tools
  23. 23. about.me/janamou Dart Editor Dartium Dart SDK
  24. 24. Dart Editor
  25. 25. Dart VM Libraries Command Line Tools Dart SDK
  26. 26. Dart VM Libraries Command Line Tools Dart SDK dart2js dartanalyzer pubdocgen
  27. 27. Libraries
  28. 28. dart:core dart:html dart:math dart:convert dart:js dart:web_gl … and more on https://api.dartlang.org/apidocs/ about.me/janamou
  29. 29. import 'dart:html'; ButtonElement myButton; void main() { myButton = querySelector('#myButton'); myButton.onClick.listen(updateText); } void updateText(Event event) { myButton.text = "Hello world Dart!"; } dart:html about.me/janamou
  30. 30. dart:convert about.me/janamou import 'dart:convert'; void main() { String jsonString = '{"name": "Jana", "surname": "Moudra"}'; Map jsonMap = JSON.decode(jsonString); print(jsonMap["name"]); //prints Jana print(jsonMap["surname"]); //prints Moudra }
  31. 31. dart:js about.me/janamou <script type="text/javascript"> var Person = function(name, surname) { this.name = name; this.surname = surname; this.sayHello = function(){ alert("Hello!"); } }; </script>
  32. 32. dart:js about.me/janamou import 'dart:js'; void main() { var person = new JsObject(context['Person'], ["Jana", "Moudra"]); print(person["name"]); print(person["surname"]); person.callMethod("sayHello"); }
  33. 33. AngularDart Polymer.dart StageXL three.dart vector_math … and more on https://pub.dartlang.org/ about.me/janamou
  34. 34. How to start?
  35. 35. How to start? www.dartlang.org
  36. 36. GET STARTED www.dartlang.org/codelabs/darrrt/
  37. 37. DOCS > TUTORIALS www.dartlang.org/docs/tutorials/
  38. 38. DART API REFERENCE https://api.dartlang.org/apidocs/ DOCS > DART: UP AND RUNNING www.dartlang.org/docs/dart-up-and-running/
  39. 39. DOCS > API REFERENCE https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/home
  40. 40. PUB https://pub.dartlang.org/
  41. 41. SAMPLES www.dartlang.org/samples/
  42. 42. Thank You! and happy Dart coding :-) about.me/janamou
  43. 43. https://www.dartlang.org/ http://news.dartlang.org/ https://pub.dartlang.org/ https://github.com/dart-lang https://plus.google.com/+dartlang/ https://www.dartlang.org/articles/idiomatic-dart/ Dart Resources

×