SlideShare uma empresa Scribd logo
1 de 17
DART Programming Language
Krishna Teja Swarna
26
What is Dart?
 Dart is an object oriented language
 Dart is an open source and scalable programming language with many built-in
libraries
 Useful for developing web, server and mobile applications
 optionally typed, and single threaded programming language.
 Similar to other OOP languages it supports classes, objects and methods.
DART LANGUAGE: ORIGINS
 Developed by Google
 Dart was unveiled at the GOTO conference in Aarhus, Denmark, October 10, 2011.
 Founded by Lars Bak and Kasper Lund, Legacy developers of V8 JavaScript Engine
used in Chrome
 The first version Dart 1.0 was released on November 14, 2013
 Latest version (DART 2.2) was released on February 26, 2019.
DART LANGUAGE: INFLUENCES
 Object Model: Smalltalk
 Syntax: JavaScript, Java, C#
 Isolates: Erlang
 Compilation Strategy: Dart itself
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
 Dart doesn’t support keywords public, private and protected
 If an identifier starts with an underscore(_), it is private to its library
 Dart tools can report two kinds of problems: warnings and errors
Cont.….
 Dart has two runtime modes: production and checked.
 Production mode is the default runtime mode of a Dart program, optimized for
speed. Production mode ignores assert statements and static types.
 Checked mode is a developer-friendly mode that helps you catch some type errors
during runtime
Example Dart Program
 Main()
{
// 'var' declares a variable. dartanalyzer infers the type.
var a = “start”;
print(a);
// The type can also be declared:
num b=21;
print(b);
// final variables cannot be changed once declared
final num c=100;
print(c);
// const variables are compile-time constants
const double d=45.00;
print(d);
}
Dart Environment
 Dart Editor: An editor similar to sublime text, notepad++ etc.
 Dartium: a Web browser with Dart included (based on Chromium)
 Dart2js: used to convert dart script to java script.
 pub: a Package Manager
Dart Tools
Dart
editor
Dartium
dart2js
pub
Data Types & Operators
 Dart supports following set of data types: Numbers, Strings, Booleans, Lists, Maps
 Dart supports following operators: *, /, %, ~,+, -, << ,>>, & ,^ ,|, >=, >, <=, <, ==, !=,
&&, ||, ??, expr++, expr--, -expr, !expr etc.
 “stdout” & “stdin” provides the standard output, input streams respectively, and
“stderr” is used for errors.
 Dart has two conditional operators which acts as an alternative to if else statements −
condition ? expr1 : expr2
If condition is true, then expr1 (and returns its value) get evaluated; otherwise expr2
will be evaluated.
expr1 ?? expr2
If expr1 is not null, then it gets evaluated its value is returned; otherwise it evaluates the
expr2.
Loops
The for loop executes the code block for a specified number of times.
Syntax: for ( initial_count_value, termination condition, step) {
//statements
}
Example:
void main() {
var num = 5;
var factorial = 1;
for( var I = num; I >= 1; i--) {
factorial *= 1;
}
print(factorial);
}
 The while loop executes the instructions each time the condition specified
evaluates to true.
Syntax: While (expression) {
//statements
}
Example:
void main() {
var num = 5;
var factorial = 1;
while(num>=1) {
factorial = factorial*num;
num --;
}
print(“The factorial is ${factorial}”);
}
 The do…while loop is similar to while loop except that the condition is checked
after the statements are executed.
Syntax: do {
// statements to be executed
} while(expression);
Example:
void main() {
var n =10;
do {
print(n);
n--;
}
while(n>=0);
}
Functions
 Dart has similar function implementation to languages such as Java and C#.
 For functions that contain just one expression, we can use a shorthand syntax
 The syntax of the short hand function is:
Function_name() => expression;
 Only an expression, not a statement, can appear between arrow (=>) and
semicolon (;). For example, you can’t put an if statement there, but you can use a
conditional expression.
Example of Functions:
 // A simple function definition
yell(str) => str.toUpperCase();
// Functions can have type annotations
List lines(String str) {
return str.split('n');
}
main() {
var poemLines = lines(poem);
print(yell(poemLines.first));
// functions are first-class
var whisper = (String str) => str.toLowerCase();
print(poemLines.map(whisper).last);
}
const poem = '''
The wren
Earns his living
Noiselessly.''';
Output:
 Output:$ dart functions.dart
THE WREN
noiselessly.
Encapsulation & Inheritance
 Dart introduces its own library based encapsulation model.
 In Dart there is no need to encapsulate class field, instead we do the encapsulation
with getters and setters.
 Dart supports single inheritance on a class-by-class basis, which indicates that it
can inherit properties from only one class at a time.
 Dart implements inheritance with the “extends” keyword.
Applications
 DART is mainly used to build single page web applications like Gmail, Google
Maps, and Google Instant Search etc.
 Chrome Dev Editor- An open source IDE for developing Chrome packaged apps as well
as Dart web apps.
 Soundtrap - It is a web application used for recording music with your browser is built
with Dart.
 Blossom – It is an agile project management tool built with Dart.
 Google internal tool for marketing - Built with AngularDart.

Mais conteúdo relacionado

Mais procurados (20)

What is Flutter
What is FlutterWhat is Flutter
What is Flutter
 
Flutter Session GDSC BPIT.pptx
Flutter Session GDSC BPIT.pptxFlutter Session GDSC BPIT.pptx
Flutter Session GDSC BPIT.pptx
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 
basics dart.pdf
basics dart.pdfbasics dart.pdf
basics dart.pdf
 
Flutter workshop
Flutter workshopFlutter workshop
Flutter workshop
 
Java API
Java APIJava API
Java API
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Flutter
FlutterFlutter
Flutter
 
A flight with Flutter
A flight with FlutterA flight with Flutter
A flight with Flutter
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to Flutter
 
Flutter
FlutterFlutter
Flutter
 
Flutter
Flutter Flutter
Flutter
 
Flutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | Edureka
 
flutter.school #HelloWorld
flutter.school #HelloWorldflutter.school #HelloWorld
flutter.school #HelloWorld
 
Flutter
FlutterFlutter
Flutter
 
Flutter
FlutterFlutter
Flutter
 
Swift Introduction
Swift IntroductionSwift Introduction
Swift Introduction
 
The magic of flutter
The magic of flutterThe magic of flutter
The magic of flutter
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 

Semelhante a Dart ppt

Chapter 2 Flutter Basics Lecture 1.pptx
Chapter 2 Flutter Basics Lecture 1.pptxChapter 2 Flutter Basics Lecture 1.pptx
Chapter 2 Flutter Basics Lecture 1.pptxfarxaanfarsamo
 
Dart PPT.pptx
Dart PPT.pptxDart PPT.pptx
Dart PPT.pptxDSCMESCOE
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1SURBHI SAROHA
 
Dart structured web apps
Dart   structured web appsDart   structured web apps
Dart structured web appschrisbuckett
 
Dart, unicorns and rainbows
Dart, unicorns and rainbowsDart, unicorns and rainbows
Dart, unicorns and rainbowschrisbuckett
 
1-introduction-to-dart-programming.pptx
1-introduction-to-dart-programming.pptx1-introduction-to-dart-programming.pptx
1-introduction-to-dart-programming.pptxansariparveen06
 
330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptxpraxyvines
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Martin Odersky
 
Chapter3
Chapter3Chapter3
Chapter3Kamran
 
Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepChandramouli Biyyala
 
Language tour of dart
Language tour of dartLanguage tour of dart
Language tour of dartImran Qasim
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftTalentica Software
 

Semelhante a Dart ppt (20)

Dart Programming.pptx
Dart Programming.pptxDart Programming.pptx
Dart Programming.pptx
 
Chapter 2 Flutter Basics Lecture 1.pptx
Chapter 2 Flutter Basics Lecture 1.pptxChapter 2 Flutter Basics Lecture 1.pptx
Chapter 2 Flutter Basics Lecture 1.pptx
 
Dart
DartDart
Dart
 
Dart PPT.pptx
Dart PPT.pptxDart PPT.pptx
Dart PPT.pptx
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 
Dart structured web apps
Dart   structured web appsDart   structured web apps
Dart structured web apps
 
Dart, unicorns and rainbows
Dart, unicorns and rainbowsDart, unicorns and rainbows
Dart, unicorns and rainbows
 
1-introduction-to-dart-programming.pptx
1-introduction-to-dart-programming.pptx1-introduction-to-dart-programming.pptx
1-introduction-to-dart-programming.pptx
 
330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
 
Chapter3
Chapter3Chapter3
Chapter3
 
What's New in C++ 11?
What's New in C++ 11?What's New in C++ 11?
What's New in C++ 11?
 
Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by Step
 
Language tour of dart
Language tour of dartLanguage tour of dart
Language tour of dart
 
Oops lecture 1
Oops lecture 1Oops lecture 1
Oops lecture 1
 
Scala On Android
Scala On AndroidScala On Android
Scala On Android
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
C++ language
C++ languageC++ language
C++ language
 

Último

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 

Último (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 

Dart ppt

  • 2. What is Dart?  Dart is an object oriented language  Dart is an open source and scalable programming language with many built-in libraries  Useful for developing web, server and mobile applications  optionally typed, and single threaded programming language.  Similar to other OOP languages it supports classes, objects and methods.
  • 3. DART LANGUAGE: ORIGINS  Developed by Google  Dart was unveiled at the GOTO conference in Aarhus, Denmark, October 10, 2011.  Founded by Lars Bak and Kasper Lund, Legacy developers of V8 JavaScript Engine used in Chrome  The first version Dart 1.0 was released on November 14, 2013  Latest version (DART 2.2) was released on February 26, 2019.
  • 4. DART LANGUAGE: INFLUENCES  Object Model: Smalltalk  Syntax: JavaScript, Java, C#  Isolates: Erlang  Compilation Strategy: Dart itself
  • 5. 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  Dart doesn’t support keywords public, private and protected  If an identifier starts with an underscore(_), it is private to its library  Dart tools can report two kinds of problems: warnings and errors
  • 6. Cont.….  Dart has two runtime modes: production and checked.  Production mode is the default runtime mode of a Dart program, optimized for speed. Production mode ignores assert statements and static types.  Checked mode is a developer-friendly mode that helps you catch some type errors during runtime
  • 7. Example Dart Program  Main() { // 'var' declares a variable. dartanalyzer infers the type. var a = “start”; print(a); // The type can also be declared: num b=21; print(b); // final variables cannot be changed once declared final num c=100; print(c); // const variables are compile-time constants const double d=45.00; print(d); }
  • 8. Dart Environment  Dart Editor: An editor similar to sublime text, notepad++ etc.  Dartium: a Web browser with Dart included (based on Chromium)  Dart2js: used to convert dart script to java script.  pub: a Package Manager Dart Tools Dart editor Dartium dart2js pub
  • 9. Data Types & Operators  Dart supports following set of data types: Numbers, Strings, Booleans, Lists, Maps  Dart supports following operators: *, /, %, ~,+, -, << ,>>, & ,^ ,|, >=, >, <=, <, ==, !=, &&, ||, ??, expr++, expr--, -expr, !expr etc.  “stdout” & “stdin” provides the standard output, input streams respectively, and “stderr” is used for errors.  Dart has two conditional operators which acts as an alternative to if else statements − condition ? expr1 : expr2 If condition is true, then expr1 (and returns its value) get evaluated; otherwise expr2 will be evaluated. expr1 ?? expr2 If expr1 is not null, then it gets evaluated its value is returned; otherwise it evaluates the expr2.
  • 10. Loops The for loop executes the code block for a specified number of times. Syntax: for ( initial_count_value, termination condition, step) { //statements } Example: void main() { var num = 5; var factorial = 1; for( var I = num; I >= 1; i--) { factorial *= 1; } print(factorial); }
  • 11.  The while loop executes the instructions each time the condition specified evaluates to true. Syntax: While (expression) { //statements } Example: void main() { var num = 5; var factorial = 1; while(num>=1) { factorial = factorial*num; num --; } print(“The factorial is ${factorial}”); }
  • 12.  The do…while loop is similar to while loop except that the condition is checked after the statements are executed. Syntax: do { // statements to be executed } while(expression); Example: void main() { var n =10; do { print(n); n--; } while(n>=0); }
  • 13. Functions  Dart has similar function implementation to languages such as Java and C#.  For functions that contain just one expression, we can use a shorthand syntax  The syntax of the short hand function is: Function_name() => expression;  Only an expression, not a statement, can appear between arrow (=>) and semicolon (;). For example, you can’t put an if statement there, but you can use a conditional expression.
  • 14. Example of Functions:  // A simple function definition yell(str) => str.toUpperCase(); // Functions can have type annotations List lines(String str) { return str.split('n'); } main() { var poemLines = lines(poem); print(yell(poemLines.first)); // functions are first-class var whisper = (String str) => str.toLowerCase(); print(poemLines.map(whisper).last); } const poem = ''' The wren Earns his living Noiselessly.''';
  • 15. Output:  Output:$ dart functions.dart THE WREN noiselessly.
  • 16. Encapsulation & Inheritance  Dart introduces its own library based encapsulation model.  In Dart there is no need to encapsulate class field, instead we do the encapsulation with getters and setters.  Dart supports single inheritance on a class-by-class basis, which indicates that it can inherit properties from only one class at a time.  Dart implements inheritance with the “extends” keyword.
  • 17. Applications  DART is mainly used to build single page web applications like Gmail, Google Maps, and Google Instant Search etc.  Chrome Dev Editor- An open source IDE for developing Chrome packaged apps as well as Dart web apps.  Soundtrap - It is a web application used for recording music with your browser is built with Dart.  Blossom – It is an agile project management tool built with Dart.  Google internal tool for marketing - Built with AngularDart.