DISCOVER DART(LANG)
STÉPHANE ESTE-GRACIAS - 15/02/2017
DISCOVER DART(LANG)
THANKS TO
NYUKO.LU REYER.IO
INTRODUCTION
DISCOVER DART(LANG) - INTRODUCTION
DART LANGUAGE: ORIGINS
▸ Open Source Software under a BSD license
▸ Starting in October 2011
▸ Originally developed by Google
▸ Approved as a standard by Ecma in June 2014: ECMA-408
▸ Designed by Lars Bak and Kasper Lund
▸ Legacy developers of V8 Javascript Engine used in Chrome
DISCOVER DART(LANG) - INTRODUCTION
DART LANGUAGE: INFLUENCES
▸ Syntax: Javascript, Java, C#
▸ Object Model: Smalltalk
▸ Optional Types: Strongtalk
▸ Isolates: Erlang
▸ Compilation Strategy: Dart itself
▸ Dart sounds familiar to “mainstream” developers
DISCOVER DART(LANG) - INTRODUCTION
DART LANGUAGE: PURPOSES
▸ General-purpose and multi-platform programming language
▸ Easy to learn
▸ Easy to scale
▸ Deployable everywhere
▸ Web (Angular Dart), Mobile (Flutter), Server (VM)
▸ Command Line, IoT…
DISCOVER DART(LANG) - INTRODUCTION
DART LANGUAGE: ON PRODUCTION
▸ Google depends on Dart to make very large applications
▸ AdWords, AdSense, Internal CRM, Google Fiber…
▸ Over 2 million lines of production Dart code

Apps can reach hundreds of thousands of lines of code
▸ ReyeR has developed with Dart for 4 years now
▸ BikeMike.Mobi, Daanuu
DISCOVER DART(LANG) - INTRODUCTION
DART’S NOT JUST A LANGUAGE
▸ Well-crafted core libraries
▸ pub: a Package Manager
▸ Packages are available at pub.dartlang.org
▸ dartanalyzer: a static Analysis Tool for real-time analysis and code completion
▸ dartfmt: a source code reformatter for common coding conventions
▸ dartdoc: generate HTML documentation (triple slashes comments (///))
▸ dartium: a Web browser with Dart included (based on Chromium)
▸ …Unit test, Code Coverage, Profiling….
LANGUAGE
DISCOVER DART(LANG) - LANGUAGE
HELLO WORLD
void main() {

for (int i = 0; i < 5; i++) {

print('hello ${i + 1}');

}

}

$ dart hello_world.dart
hello 1
hello 2
hello 3
hello 4
hello 5
DISCOVER DART(LANG) - LANGUAGE
KEYWORDS
▸ class abstract final static implements extends with
▸ new factory get set this super operator
▸ null false true void const var dynamic typedef enum
▸ if else switch case do for in while assert
▸ return break continue
▸ try catch finally throw rethrow
▸ library part import export deferred default external
▸ async async* await yield sync* yield*
DISCOVER DART(LANG) - LANGUAGE
OPERATORS
▸ expr++ expr-- -expr !expr ~expr ++expr --expr
▸ () [] . ?. ..
▸ * / % ~/ + - << >> & ^ |
▸ >= > <= < as is is! == != && || ??
▸ expr1 ? expr2 : expr3
▸ = *= /= ~/= %= += -= <<= >>= &= ^= |= ??=
DISCOVER DART(LANG) - LANGUAGE
IMPORTANT CONCEPTS
▸ Everything is an object
▸ Even numbers, booleans, functions and null are objects
▸ Every object is an instance of a class that inherit from Object
▸ Everything is nullable
▸ null is the default value of every uninitialised object
▸ Static types are recommended for static checking by tools, but it’s optional
▸ If an identifier starts with an underscore (_), it’s private to its library
DISCOVER DART(LANG) - LANGUAGE
VARIABLES
var name = 'Bob';

var number = 42;



int number;

String string;

int number = 42;

String name = 'Bob';
DISCOVER DART(LANG) - LANGUAGE
FUNCTION: FAT ARROW
bool isNoble(int number) {

return _nobleGases[number] != null;

}
bool isNoble(int number) => _nobleGases[number] != null
=> expr syntax is a shorthand for { return expr; }
DISCOVER DART(LANG) - LANGUAGE
FUNCTION: OPTIONAL NAMED PARAMETERS
enableFlags({bool bold, bool hidden}) {

// ...

}



enableFlags(bold: true, hidden: false);
DISCOVER DART(LANG) - LANGUAGE
FUNCTION: OPTIONAL POSITIONAL PARAMETERS
String say(String from, String msg, [String device]) {

var result = '$from says $msg';

if (device != null) {

result = '$result with a $device';

}

return result;

}



assert(say('Bob', 'Howdy') == 'Bob says Howdy’);


assert(say('Bob', 'Howdy', 'phone') == 'Bob says Howdy with a phone');
DISCOVER DART(LANG) - LANGUAGE
CLASS / CONSTRUCTOR / NAMED CONSTRUCTORS
import 'dart:math';



class Point {

num x;

num y;



Point(this.x, this.y);
Point.fromJson(Map json) {

x = json['x'];

y = json['y'];

}
...
...



num distanceTo(Point other) {

var dx = x - other.x;

var dy = y - other.y;

return sqrt(dx * dx + dy * dy);

}

}
DISCOVER DART(LANG) - LANGUAGE
CASCADE NOTATION
var address = getAddress();

address.setStreet(“Elm”, “42”)

address.city = “Carthage”

address.state = “Eurasia”

address.zip(1234, extended: 5678);



getAddress()

..setStreet(“Elm”, “42”)

..city = “Carthage”

..state = “Eurasia”

..zip(1234, extended: 5678);
result = x ?? value;

// equivalent to

result = x == null ? value : x;
x ??= value;

// equivalent to

x = x == null ? value : x;
p?.y = 4;

// equivalent to

if (p != null) {

p.y = 4;

}
NULL AWARE OPERATORS
DISCOVER DART(LANG) - LANGUAGE
FUTURE & ASYNCHRONOUS
Future<String> lookUpVersion() async => '1.0.0';



Future<bool> checkVersion() async {

var version = await lookUpVersion();

return version == expected;

}




try {

server = await HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 4044);

} catch (e) {

// React to inability to bind to the port...

}
GETTING STARTED
DISCOVER DART(LANG) - GETTING STARTED
TRY DART ONLINE
▸ Online with DartPad https://dartpad.dartlang.org/

Supports only a few core libraries
DISCOVER DART(LANG) - GETTING STARTED
INSTALL DART ON YOUR FAVORITE PLATFORM
▸ Install Dart on MacOS, Linux Ubuntu/Debian, Windows
▸ Install an IDE
▸ Recommended: WebStorm or IntelliJ (for Flutter)
▸ Dart Plugins available for
▸ Atom, Sublime Text 3, Visual Studio Code, Emacs, Vim
DART VM
DISCOVER DART(LANG) - DART VM
CONSOLE APPLICATION; PUBSPEC.YAML
name: console

version: 0.0.1

description: A sample command-line application.

#author: someone <email@example.com>

#homepage: https://www.example.com



environment:

sdk: '>=1.0.0 <2.0.0'



dependencies:

foo_bar: '>=1.0.0 <2.0.0'



dev_dependencies:

test: '>=0.12.0 <0.13.0'
DISCOVER DART(LANG) - DART VM
CONSOLE APPLICATION; LIB/CONSOLE.DART
int calculate() {

return 6 * 7;

}

DISCOVER DART(LANG) - DART VM
CONSOLE APPLICATION; BIN/MAIN.DART
import 'package:console/console.dart' as console;



main(List<String> arguments) {

print('Hello world: ${console.calculate()}!');

}
$ dart bin/main.dart
Hello world: 42!
DISCOVER DART(LANG) - DART VM
CONSOLE APPLICATION; TEST/CONSOLE_TEST.DART
import 'package:console/console.dart';

import 'package:test/test.dart';



void main() {

test('calculate', () {

expect(calculate(), 42);

});

}

$ pub run test
00:00 +1: All tests passed!
DART WEBDEV
DISCOVER DART(LANG) - DART WEBDEV
SIMPLE WEB APPLICATION: PUBSPEC.YAML
name: 'web'

version: 0.0.1

description: An absolute bare-bones web app.

#author: someone <email@example.com>

#homepage: https://www.example.com



environment:

sdk: '>=1.0.0 <2.0.0'



#dependencies:

# my_dependency: any



dev_dependencies:

browser: '>=0.10.0 <0.11.0'

dart_to_js_script_rewriter: '^1.0.1'



transformers:

- dart_to_js_script_rewriter
DISCOVER DART(LANG) - DART WEBDEV
SIMPLE WEB APPLICATION: INDEX.HTML
<!DOCTYPE html>

<html>
<head>

...
<title>web</title>

<link rel="stylesheet" href="styles.css">

<script defer src=“main.dart"
type=“application/dart">
</script>

<script defer src=“packages/browser/dart.js">
</script>

</head>

<body>

<div id="output"></div>

</body>
</html>
DISCOVER DART(LANG) - DART WEBDEV
SIMPLE WEB APPLICATION: STYLES.CSS
@import url(https://fonts.googleapis.com/css?
family=Roboto);



html, body {

width: 100%;

height: 100%;

margin: 0;

padding: 0;

font-family: 'Roboto', sans-serif;

}
DISCOVER DART(LANG) - DART WEBDEV
SIMPLE WEB APPLICATION: MAIN.DART
import 'dart:html';



void main() {

querySelector(‘#output')
.text = 'Your Dart app is running.';

}
COMMUNITY
DISCOVER DART(LANG) - COMMUNITY
EVENTS
▸ Dart Events

https://events.dartlang.org
▸ Dart Developper Summit

https://events.dartlang.org/2016/summit/

https://www.youtube.com/playlist?list=PLOU2XLYxmsILKY-
A1kq4eHMcku3GMAyp2
▸ Meetup Luxembourg Dart Lang

https://www.meetup.com/Luxembourg-Dart-Lang-Meetup/
DISCOVER DART(LANG) - COMMUNITY
USEFUL LINKS
▸ Dart lang website https://www.dartlang.org
▸ Questions on StackOverflow http://stackoverflow.com/tags/dart
▸ Chat on Gitter https://gitter.im/dart-lang
▸ Learn from experts https://dart.academy/
▸ Source code on Github https://github.com/dart-lang
Q&A
Discover Dart - Meetup 15/02/2017

More Related Content

PDF
Discover Dart(lang) - Meetup 07/12/2016
PDF
Dart on server - Meetup 18/05/2017
PDF
AngularDart - Meetup 15/03/2017
PPTX
Value protocols and codables
PDF
Ethiopian multiplication in Perl6
PDF
Perforce Object and Record Model
PPTX
Linux networking
PDF
BSDM with BASH: Command Interpolation
Discover Dart(lang) - Meetup 07/12/2016
Dart on server - Meetup 18/05/2017
AngularDart - Meetup 15/03/2017
Value protocols and codables
Ethiopian multiplication in Perl6
Perforce Object and Record Model
Linux networking
BSDM with BASH: Command Interpolation

What's hot (17)

PPTX
Ansible for Beginners
PDF
Hypers and Gathers and Takes! Oh my!
PPTX
(Practical) linux 104
PDF
Unleash your inner console cowboy
PDF
extending-php
PDF
COSCUP2012: How to write a bash script like the python?
PDF
Beautiful Bash: Let's make reading and writing bash scripts fun again!
PDF
BASH Guide Summary
KEY
groovy & grails - lecture 4
PDF
Doing It Wrong with Puppet -
PPTX
Bash Shell Scripting
PPTX
(Practical) linux 101
PDF
Web Audio API + AngularJS
PDF
The $path to knowledge: What little it take to unit-test Perl.
PPT
Bash shell
PDF
Alfresco the clojure way -- Slides from the Alfresco DevCon2011
PPTX
Migrating to Puppet 4.0
Ansible for Beginners
Hypers and Gathers and Takes! Oh my!
(Practical) linux 104
Unleash your inner console cowboy
extending-php
COSCUP2012: How to write a bash script like the python?
Beautiful Bash: Let's make reading and writing bash scripts fun again!
BASH Guide Summary
groovy & grails - lecture 4
Doing It Wrong with Puppet -
Bash Shell Scripting
(Practical) linux 101
Web Audio API + AngularJS
The $path to knowledge: What little it take to unit-test Perl.
Bash shell
Alfresco the clojure way -- Slides from the Alfresco DevCon2011
Migrating to Puppet 4.0
Ad

Similar to Discover Dart - Meetup 15/02/2017 (20)

PPTX
Dart ppt
PPTX
Dart programming language
PPTX
Dart Programming.pptx
PDF
Introduction to Dart
PPT
No JS and DartCon
PDF
Introduction to Flutter - truly crossplatform, amazingly fast
PPTX
App_development55555555555555555555.pptx
PDF
OWF12/PAUG Conf Days Dart a new html5 technology, nicolas geoffray, softwar...
PPTX
Dart, unicorns and rainbows
PDF
Dart workshop
PDF
Structured Apps with Google Dart
PDF
Dart
PPTX
pembelajaran tentang dart dalam bahasa inggris
PDF
A brief introduction to dart
PPTX
Dartprogramming
PPTX
Chapter 2 Flutter Basics Lecture 1.pptx
PDF
GDG DART Event at Karachi
PDF
What’s new in Google Dart - Seth Ladd
Dart ppt
Dart programming language
Dart Programming.pptx
Introduction to Dart
No JS and DartCon
Introduction to Flutter - truly crossplatform, amazingly fast
App_development55555555555555555555.pptx
OWF12/PAUG Conf Days Dart a new html5 technology, nicolas geoffray, softwar...
Dart, unicorns and rainbows
Dart workshop
Structured Apps with Google Dart
Dart
pembelajaran tentang dart dalam bahasa inggris
A brief introduction to dart
Dartprogramming
Chapter 2 Flutter Basics Lecture 1.pptx
GDG DART Event at Karachi
What’s new in Google Dart - Seth Ladd
Ad

More from Stéphane Este-Gracias (8)

PDF
HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...
PDF
20221130 - Luxembourg HUG Meetup
PDF
20220928 - Luxembourg HUG Meetup
PDF
20220202 - Luxembourg HUG Meetup
PDF
20220608 - Luxembourg HUG Meetup
PDF
Shift your Workspaces to the Cloud
PDF
Discover Angular - Meetup 15/02/2017
PDF
Discover Flutter - Meetup 07/12/2016
HashiTalks France 2023 - Sécurisez la distribution automatique de vos certif...
20221130 - Luxembourg HUG Meetup
20220928 - Luxembourg HUG Meetup
20220202 - Luxembourg HUG Meetup
20220608 - Luxembourg HUG Meetup
Shift your Workspaces to the Cloud
Discover Angular - Meetup 15/02/2017
Discover Flutter - Meetup 07/12/2016

Recently uploaded (20)

PPTX
Trending Python Topics for Data Visualization in 2025
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PPTX
Cybersecurity: Protecting the Digital World
PDF
AI Guide for Business Growth - Arna Softech
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PPTX
most interesting chapter in the world ppt
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
E-Commerce Website Development Companyin india
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PPTX
Introduction to Windows Operating System
PPTX
Computer Software - Technology and Livelihood Education
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PPTX
CNN LeNet5 Architecture: Neural Networks
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Trending Python Topics for Data Visualization in 2025
Salesforce Agentforce AI Implementation.pdf
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Cybersecurity: Protecting the Digital World
AI Guide for Business Growth - Arna Softech
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
most interesting chapter in the world ppt
CCleaner 6.39.11548 Crack 2025 License Key
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
MCP Security Tutorial - Beginner to Advanced
E-Commerce Website Development Companyin india
iTop VPN Crack Latest Version Full Key 2025
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Introduction to Windows Operating System
Computer Software - Technology and Livelihood Education
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
CNN LeNet5 Architecture: Neural Networks
Topaz Photo AI Crack New Download (Latest 2025)
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access

Discover Dart - Meetup 15/02/2017

  • 4. DISCOVER DART(LANG) - INTRODUCTION DART LANGUAGE: ORIGINS ▸ Open Source Software under a BSD license ▸ Starting in October 2011 ▸ Originally developed by Google ▸ Approved as a standard by Ecma in June 2014: ECMA-408 ▸ Designed by Lars Bak and Kasper Lund ▸ Legacy developers of V8 Javascript Engine used in Chrome
  • 5. DISCOVER DART(LANG) - INTRODUCTION DART LANGUAGE: INFLUENCES ▸ Syntax: Javascript, Java, C# ▸ Object Model: Smalltalk ▸ Optional Types: Strongtalk ▸ Isolates: Erlang ▸ Compilation Strategy: Dart itself ▸ Dart sounds familiar to “mainstream” developers
  • 6. DISCOVER DART(LANG) - INTRODUCTION DART LANGUAGE: PURPOSES ▸ General-purpose and multi-platform programming language ▸ Easy to learn ▸ Easy to scale ▸ Deployable everywhere ▸ Web (Angular Dart), Mobile (Flutter), Server (VM) ▸ Command Line, IoT…
  • 7. DISCOVER DART(LANG) - INTRODUCTION DART LANGUAGE: ON PRODUCTION ▸ Google depends on Dart to make very large applications ▸ AdWords, AdSense, Internal CRM, Google Fiber… ▸ Over 2 million lines of production Dart code
 Apps can reach hundreds of thousands of lines of code ▸ ReyeR has developed with Dart for 4 years now ▸ BikeMike.Mobi, Daanuu
  • 8. DISCOVER DART(LANG) - INTRODUCTION DART’S NOT JUST A LANGUAGE ▸ Well-crafted core libraries ▸ pub: a Package Manager ▸ Packages are available at pub.dartlang.org ▸ dartanalyzer: a static Analysis Tool for real-time analysis and code completion ▸ dartfmt: a source code reformatter for common coding conventions ▸ dartdoc: generate HTML documentation (triple slashes comments (///)) ▸ dartium: a Web browser with Dart included (based on Chromium) ▸ …Unit test, Code Coverage, Profiling….
  • 10. DISCOVER DART(LANG) - LANGUAGE HELLO WORLD void main() {
 for (int i = 0; i < 5; i++) {
 print('hello ${i + 1}');
 }
 }
 $ dart hello_world.dart hello 1 hello 2 hello 3 hello 4 hello 5
  • 11. DISCOVER DART(LANG) - LANGUAGE KEYWORDS ▸ class abstract final static implements extends with ▸ new factory get set this super operator ▸ null false true void const var dynamic typedef enum ▸ if else switch case do for in while assert ▸ return break continue ▸ try catch finally throw rethrow ▸ library part import export deferred default external ▸ async async* await yield sync* yield*
  • 12. DISCOVER DART(LANG) - LANGUAGE OPERATORS ▸ expr++ expr-- -expr !expr ~expr ++expr --expr ▸ () [] . ?. .. ▸ * / % ~/ + - << >> & ^ | ▸ >= > <= < as is is! == != && || ?? ▸ expr1 ? expr2 : expr3 ▸ = *= /= ~/= %= += -= <<= >>= &= ^= |= ??=
  • 13. DISCOVER DART(LANG) - LANGUAGE IMPORTANT CONCEPTS ▸ Everything is an object ▸ Even numbers, booleans, functions and null are objects ▸ Every object is an instance of a class that inherit from Object ▸ Everything is nullable ▸ null is the default value of every uninitialised object ▸ Static types are recommended for static checking by tools, but it’s optional ▸ If an identifier starts with an underscore (_), it’s private to its library
  • 14. DISCOVER DART(LANG) - LANGUAGE VARIABLES var name = 'Bob';
 var number = 42;
 
 int number;
 String string;
 int number = 42;
 String name = 'Bob';
  • 15. DISCOVER DART(LANG) - LANGUAGE FUNCTION: FAT ARROW bool isNoble(int number) {
 return _nobleGases[number] != null;
 } bool isNoble(int number) => _nobleGases[number] != null => expr syntax is a shorthand for { return expr; }
  • 16. DISCOVER DART(LANG) - LANGUAGE FUNCTION: OPTIONAL NAMED PARAMETERS enableFlags({bool bold, bool hidden}) {
 // ...
 }
 
 enableFlags(bold: true, hidden: false);
  • 17. DISCOVER DART(LANG) - LANGUAGE FUNCTION: OPTIONAL POSITIONAL PARAMETERS String say(String from, String msg, [String device]) {
 var result = '$from says $msg';
 if (device != null) {
 result = '$result with a $device';
 }
 return result;
 }
 
 assert(say('Bob', 'Howdy') == 'Bob says Howdy’); 
 assert(say('Bob', 'Howdy', 'phone') == 'Bob says Howdy with a phone');
  • 18. DISCOVER DART(LANG) - LANGUAGE CLASS / CONSTRUCTOR / NAMED CONSTRUCTORS import 'dart:math';
 
 class Point {
 num x;
 num y;
 
 Point(this.x, this.y); Point.fromJson(Map json) {
 x = json['x'];
 y = json['y'];
 } ... ...
 
 num distanceTo(Point other) {
 var dx = x - other.x;
 var dy = y - other.y;
 return sqrt(dx * dx + dy * dy);
 }
 }
  • 19. DISCOVER DART(LANG) - LANGUAGE CASCADE NOTATION var address = getAddress();
 address.setStreet(“Elm”, “42”)
 address.city = “Carthage”
 address.state = “Eurasia”
 address.zip(1234, extended: 5678);
 
 getAddress()
 ..setStreet(“Elm”, “42”)
 ..city = “Carthage”
 ..state = “Eurasia”
 ..zip(1234, extended: 5678); result = x ?? value;
 // equivalent to
 result = x == null ? value : x; x ??= value;
 // equivalent to
 x = x == null ? value : x; p?.y = 4;
 // equivalent to
 if (p != null) {
 p.y = 4;
 } NULL AWARE OPERATORS
  • 20. DISCOVER DART(LANG) - LANGUAGE FUTURE & ASYNCHRONOUS Future<String> lookUpVersion() async => '1.0.0';
 
 Future<bool> checkVersion() async {
 var version = await lookUpVersion();
 return version == expected;
 } 
 
 try {
 server = await HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 4044);
 } catch (e) {
 // React to inability to bind to the port...
 }
  • 22. DISCOVER DART(LANG) - GETTING STARTED TRY DART ONLINE ▸ Online with DartPad https://dartpad.dartlang.org/
 Supports only a few core libraries
  • 23. DISCOVER DART(LANG) - GETTING STARTED INSTALL DART ON YOUR FAVORITE PLATFORM ▸ Install Dart on MacOS, Linux Ubuntu/Debian, Windows ▸ Install an IDE ▸ Recommended: WebStorm or IntelliJ (for Flutter) ▸ Dart Plugins available for ▸ Atom, Sublime Text 3, Visual Studio Code, Emacs, Vim
  • 25. DISCOVER DART(LANG) - DART VM CONSOLE APPLICATION; PUBSPEC.YAML name: console
 version: 0.0.1
 description: A sample command-line application.
 #author: someone <email@example.com>
 #homepage: https://www.example.com
 
 environment:
 sdk: '>=1.0.0 <2.0.0'
 
 dependencies:
 foo_bar: '>=1.0.0 <2.0.0'
 
 dev_dependencies:
 test: '>=0.12.0 <0.13.0'
  • 26. DISCOVER DART(LANG) - DART VM CONSOLE APPLICATION; LIB/CONSOLE.DART int calculate() {
 return 6 * 7;
 }

  • 27. DISCOVER DART(LANG) - DART VM CONSOLE APPLICATION; BIN/MAIN.DART import 'package:console/console.dart' as console;
 
 main(List<String> arguments) {
 print('Hello world: ${console.calculate()}!');
 } $ dart bin/main.dart Hello world: 42!
  • 28. DISCOVER DART(LANG) - DART VM CONSOLE APPLICATION; TEST/CONSOLE_TEST.DART import 'package:console/console.dart';
 import 'package:test/test.dart';
 
 void main() {
 test('calculate', () {
 expect(calculate(), 42);
 });
 }
 $ pub run test 00:00 +1: All tests passed!
  • 30. DISCOVER DART(LANG) - DART WEBDEV SIMPLE WEB APPLICATION: PUBSPEC.YAML name: 'web'
 version: 0.0.1
 description: An absolute bare-bones web app.
 #author: someone <email@example.com>
 #homepage: https://www.example.com
 
 environment:
 sdk: '>=1.0.0 <2.0.0'
 
 #dependencies:
 # my_dependency: any
 
 dev_dependencies:
 browser: '>=0.10.0 <0.11.0'
 dart_to_js_script_rewriter: '^1.0.1'
 
 transformers:
 - dart_to_js_script_rewriter
  • 31. DISCOVER DART(LANG) - DART WEBDEV SIMPLE WEB APPLICATION: INDEX.HTML <!DOCTYPE html>
 <html> <head>
 ... <title>web</title>
 <link rel="stylesheet" href="styles.css">
 <script defer src=“main.dart" type=“application/dart"> </script>
 <script defer src=“packages/browser/dart.js"> </script>
 </head>
 <body>
 <div id="output"></div>
 </body> </html>
  • 32. DISCOVER DART(LANG) - DART WEBDEV SIMPLE WEB APPLICATION: STYLES.CSS @import url(https://fonts.googleapis.com/css? family=Roboto);
 
 html, body {
 width: 100%;
 height: 100%;
 margin: 0;
 padding: 0;
 font-family: 'Roboto', sans-serif;
 }
  • 33. DISCOVER DART(LANG) - DART WEBDEV SIMPLE WEB APPLICATION: MAIN.DART import 'dart:html';
 
 void main() {
 querySelector(‘#output') .text = 'Your Dart app is running.';
 }
  • 35. DISCOVER DART(LANG) - COMMUNITY EVENTS ▸ Dart Events
 https://events.dartlang.org ▸ Dart Developper Summit
 https://events.dartlang.org/2016/summit/
 https://www.youtube.com/playlist?list=PLOU2XLYxmsILKY- A1kq4eHMcku3GMAyp2 ▸ Meetup Luxembourg Dart Lang
 https://www.meetup.com/Luxembourg-Dart-Lang-Meetup/
  • 36. DISCOVER DART(LANG) - COMMUNITY USEFUL LINKS ▸ Dart lang website https://www.dartlang.org ▸ Questions on StackOverflow http://stackoverflow.com/tags/dart ▸ Chat on Gitter https://gitter.im/dart-lang ▸ Learn from experts https://dart.academy/ ▸ Source code on Github https://github.com/dart-lang
  • 37. Q&A