Technology Transition Workshop Introduction to DART MS Robert B. Cody JEOL USA, Inc.
Introduction to the Dart language
-
Upload
jana-moudra -
Category
Technology
-
view
1.100 -
download
0
description
Transcript of Introduction to the Dart language
![Page 1: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/1.jpg)
Introduction to the
Dart langJana Moudrá
![Page 2: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/2.jpg)
Co-Founder at JuicymoOrganizer at GDG ČVUT Prague/GDG Prague
Interested in Web, Android, Design, Dart
about.me/janamou
About Me
![Page 3: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/3.jpg)
about.me/janamou
![Page 4: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/4.jpg)
about.me/janamou
1.3.6
![Page 5: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/5.jpg)
Open-sourceLanguage for the Web
For better performanceGoals to replace JavaScriptReady for standardization
about.me/janamou
![Page 6: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/6.jpg)
Dartium: Chromium with Dart VM
about.me/janamou
![Page 7: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/7.jpg)
Compiled into JavaScript works
in all modern browsers
about.me/janamou
![Page 8: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/8.jpg)
Object Oriented Easy to learn Optional types
ModularCompiles to JavaScript
about.me/janamou
![Page 9: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/9.jpg)
Client Server
about.me/janamou
![Page 10: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/10.jpg)
Performance
![Page 11: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/11.jpg)
Dart Performancewww.dartlang.org/performance/
![Page 12: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/12.jpg)
Language
![Page 13: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/13.jpg)
Optional typesEvery variable
is objectTop level main()
function
Checked and Production
modesSyntactic sugar
Named constructors
… and more
about.me/janamou
Streams Futures HTML
![Page 14: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/14.jpg)
var x = 10;var y = 20;
or
num x = 10;num y = 20;
Optional types
about.me/janamou
![Page 15: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/15.jpg)
void main() { print("Hello world Dart!");
}
Top level main() function
about.me/janamou
![Page 16: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/16.jpg)
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
![Page 17: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/17.jpg)
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
![Page 18: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/18.jpg)
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
![Page 19: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/19.jpg)
void main() {
querySelector("#my-button")
..text = "Open Window" ..onClick.listen(openWindow);}
Cascade operator
about.me/janamou
![Page 20: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/20.jpg)
someFunc()
.then(printValue) .catchError(printError);
Futures I.
about.me/janamou
![Page 21: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/21.jpg)
HttpRequest.getString('shapes.json')
.then((String jsonString) { print(jsonString);
})
.catchError((Error error) { print(error.toString());
});
Futures II.
about.me/janamou
![Page 22: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/22.jpg)
Tools
![Page 23: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/23.jpg)
about.me/janamou
Dart Editor Dartium Dart SDK
![Page 24: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/24.jpg)
Dart Editor
![Page 25: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/25.jpg)
Dart VMLibraries
Command Line Tools
Dart SDK
![Page 26: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/26.jpg)
Dart VMLibraries
Command Line Tools
Dart SDK
dart2js dartanalyzer pubdocgen
![Page 27: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/27.jpg)
Libraries
![Page 28: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/28.jpg)
dart:coredart:htmldart:math
dart:convertdart:js
dart:web_gl
… and more on https://api.dartlang.org/apidocs/
about.me/janamou
![Page 29: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/29.jpg)
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
![Page 30: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/30.jpg)
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
}
![Page 31: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/31.jpg)
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>
![Page 32: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/32.jpg)
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");
}
![Page 33: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/33.jpg)
AngularDartPolymer.dart
StageXLthree.dart
vector_math
… and more on https://pub.dartlang.org/
about.me/janamou
![Page 34: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/34.jpg)
How to start?
![Page 35: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/35.jpg)
How to start?www.dartlang.org
![Page 36: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/36.jpg)
![Page 37: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/37.jpg)
GET STARTEDwww.dartlang.org/codelabs/darrrt/
![Page 38: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/38.jpg)
DOCS > TUTORIALSwww.dartlang.org/docs/tutorials/
![Page 39: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/39.jpg)
DART API REFERENCEhttps://api.dartlang.org/apidocs/
DOCS > DART: UP AND RUNNINGwww.dartlang.org/docs/dart-up-and-running/
![Page 40: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/40.jpg)
DOCS > API REFERENCEhttps://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/home
![Page 41: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/41.jpg)
PUBhttps://pub.dartlang.org/
![Page 42: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/42.jpg)
SAMPLESwww.dartlang.org/samples/
![Page 43: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/43.jpg)
![Page 44: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/44.jpg)
Thank You!and happy Dart coding :-)
about.me/janamou
![Page 45: Introduction to the Dart language](https://reader034.fdocuments.in/reader034/viewer/2022052410/554cc370b4c905e7268b4612/html5/thumbnails/45.jpg)
https://www.dartlang.org/http://news.dartlang.org/https://pub.dartlang.org/
https://github.com/dart-langhttps://plus.google.com/+dartlang/
https://www.dartlang.org/articles/idiomatic-dart/
Dart Resources