SlideShare a Scribd company logo
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.

More Related Content

What's hot

Flutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | Edureka
Edureka!
 
Flutter
FlutterFlutter
Flutter
Mohit Sharma
 
Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101
Arif Amirani
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
Vladimir Parfenov
 
Flutter
FlutterFlutter
Flutter
Dave Chao
 
Flutter: Future of App Development
Flutter: Future of App DevelopmentFlutter: Future of App Development
Flutter: Future of App Development
9 series
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
Võ Duy Tuấn
 
What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?
Sergi Martínez
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to Flutter
Apoorv Pandey
 
flutter.school #HelloWorld
flutter.school #HelloWorldflutter.school #HelloWorld
flutter.school #HelloWorld
Frederik Schweiger
 
Dart Programming.pptx
Dart Programming.pptxDart Programming.pptx
Dart Programming.pptx
AnanthalakshmiN4
 
Flutter talkshow
Flutter talkshowFlutter talkshow
Flutter talkshow
Nhan Cao
 
Flutter
FlutterFlutter
Java Servlets
Java ServletsJava Servlets
Java Servlets
BG Java EE Course
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart language
Jana Moudrá
 
What and Why Flutter? What is a Widget in Flutter?
What and Why Flutter? What is a Widget in Flutter?What and Why Flutter? What is a Widget in Flutter?
What and Why Flutter? What is a Widget in Flutter?
MohammadHussain595488
 
Flutter session 01
Flutter session 01Flutter session 01
Flutter session 01
DSC IEM
 
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
farxaanfarsamo
 
Android ui dialog
Android ui dialogAndroid ui dialog
Android ui dialogKrazy Koder
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
Aly Abdelkareem
 

What's hot (20)

Flutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | Edureka
 
Flutter
FlutterFlutter
Flutter
 
Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Flutter
FlutterFlutter
Flutter
 
Flutter: Future of App Development
Flutter: Future of App DevelopmentFlutter: Future of App Development
Flutter: Future of App Development
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 
What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to Flutter
 
flutter.school #HelloWorld
flutter.school #HelloWorldflutter.school #HelloWorld
flutter.school #HelloWorld
 
Dart Programming.pptx
Dart Programming.pptxDart Programming.pptx
Dart Programming.pptx
 
Flutter talkshow
Flutter talkshowFlutter talkshow
Flutter talkshow
 
Flutter
FlutterFlutter
Flutter
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart language
 
What and Why Flutter? What is a Widget in Flutter?
What and Why Flutter? What is a Widget in Flutter?What and Why Flutter? What is a Widget in Flutter?
What and Why Flutter? What is a Widget in Flutter?
 
Flutter session 01
Flutter session 01Flutter session 01
Flutter session 01
 
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
 
Android ui dialog
Android ui dialogAndroid ui dialog
Android ui dialog
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 

Similar to Dart ppt

Dart
DartDart
Dart PPT.pptx
Dart PPT.pptxDart PPT.pptx
Dart PPT.pptx
DSCMESCOE
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
SURBHI SAROHA
 
Dart structured web apps
Dart   structured web appsDart   structured web apps
Dart structured web apps
chrisbuckett
 
Dart, unicorns and rainbows
Dart, unicorns and rainbowsDart, unicorns and rainbows
Dart, unicorns and rainbows
chrisbuckett
 
1-introduction-to-dart-programming.pptx
1-introduction-to-dart-programming.pptx1-introduction-to-dart-programming.pptx
1-introduction-to-dart-programming.pptx
ansariparveen06
 
330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx
praxyvines
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
Martin Odersky
 
Chapter3
Chapter3Chapter3
Chapter3
Kamran
 
What's New in C++ 11?
What's New in C++ 11?What's New in C++ 11?
What's New in C++ 11?
Sasha Goldshtein
 
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
Chandramouli Biyyala
 
Language tour of dart
Language tour of dartLanguage tour of dart
Language tour of dart
Imran Qasim
 
Oops lecture 1
Oops lecture 1Oops lecture 1
Oops lecture 1
rehan16091997
 
Scala On Android
Scala On AndroidScala On Android
Scala On Android
Akshay Dashrath
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
pembelajaran tentang dart dalam bahasa inggris
pembelajaran tentang dart dalam bahasa inggrispembelajaran tentang dart dalam bahasa inggris
pembelajaran tentang dart dalam bahasa inggris
Reza120164
 
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
Talentica Software
 
C++ language
C++ languageC++ language
C++ language
Hamza Asif
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesEelco Visser
 

Similar to Dart ppt (20)

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)
 
pembelajaran tentang dart dalam bahasa inggris
pembelajaran tentang dart dalam bahasa inggrispembelajaran tentang dart dalam bahasa inggris
pembelajaran tentang dart dalam bahasa inggris
 
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
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific Languages
 

Recently uploaded

Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 

Recently uploaded (20)

Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 

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.