SlideShare a Scribd company logo
Dart language
By TechnoShip Cell Geci
Dart Programming Language
● Open-Source General-Purpose programming language.
● Developed by Google.
● This meant for the server as well as the browser.
● an object-oriented language.
● C-style syntax.
Designed By
Lars Bak and Kasper Lund
Why Dart?
Help app developers
write complex, high
fidelity client apps for
the modern web.
Dart v/s javaScript
Where Dart Using?
● Flutter Created on top of Dart.
● Flutter has an Power Full Engine to
perform smooth and lag less
performance.
● Flutter used for:
Going deep into
First Dart Program
// Entry point to Dart program
main() {
print('Hello from Dart');
}
• main() - The special, required, top-level function where app execution starts.
• Every app must have a top-level main() function, which serves as the entry
point to the app.
Comments In Dart
• Dart supports both single line and multi line comments
// Single line comment
/* This is
an example
of multi line
comment */
Built in Types
• number
• int - Integer (range -253 to 253)
• double - 64-bit (double-precision)
• string
• boolean – true and false
• symbol
• Collections
• list (arrays)
• map
• set
• runes (for expressing Unicode characters in a string)
Variable Initializing
● var name=”technoship”;
● var reg=123;
var keyword used to create static variables.
● dynamic name=”technoship”;
● dynamic reg=123;
dynamic keyword used to create dynamic variables.
● String name=”technoship”;
● int reg=123;
Variables can initialize using its data type.
List and Map
● List
List names=<String>[“Arun”,”Alen”];
List is used to store same data type items
● Map
Map rollno_name=<int,String>{1:”Arun”,2:”Alen”};
Map is an object that associates keys and values
String Interpolation
● Identifiers could be added within a string literal using $identifier or
$varaiable_name syntax.
var user = 'Bill';
var city = 'Bangalore';
print("Hello $user. Are you from $city?");
// prints Hello Bill. Are you from Bangalore?
● You can put the value of an expression inside a string by using ${expression}
print('3 + 5 = ${3 + 5}'); // prints 3 + 5 = 8
Operators in
Operands and operator
● An expression is a special kind of statement that evaluates to a value.
● Every expression is composed of −
○ Operands − Represents the data
○ Operator − Defines how the operands will be processed to produce a
value.
● Consider the following expression – "2 + 3". In this expression, 2 and 3 are
operands and the symbol "+" (plus) is the operator.
operators that are available in Dart.
● Arithmetic Operators
● Equality and Relational Operators
● Type test Operators
● Bitwise Operators
● Assignment Operators
● Logical Operators
Arithmetic Operators
Arithmetic Operators(cont..)
Equality and Relational Operators
Type test Operators
Bitwise Operators
Assignment Operators
Assignment Operators(cont..)
Logical Operators
Control flow statements
● if and else
● for loops (for and for in)
● while and do while loops
● break and continue
● switch and case
if and else
● if and else
var age = 17;
if(age >= 18){
print('you can vote');
}
else{
print('you can not vote');
}
● curly braces { } could be omitted when the blocks have a single line of code
Conditional Expressions
● Dart has two operators that let you evaluate expressions that might otherwise
require ifelse statements −
○ condition ? expr1 : expr2
● If condition is true, then the expression evaluates expr1 (and returns its value);
otherwise, it evaluates and returns the value of expr2.
● Eg:
○ var res = 10 > 12 ? "greater than 10":"lesser than or equal to 10";
● expr1 ?? expr2
● If expr1 is non-null, returns its value; otherwise, evaluates and returns the
value of expr2
else if
● Supports else if as expected
var income = 75;
if (income <= 50){
print('tax rate is 10%');
}
else if(income >50 && income <80){
print('tax rate is 20%');
}
else{
print('tax rate is 30%');
}
While & do..while
● While in dart
var num=0;
while(num<5){
print(num);
i=i+1;
}
● do..while in dart
var num=0;
do{
print(num);
i=i+1;
}while(num<5);
for loops
● Supports standard for loop (as
supported by other languages
that follow C like syntax)
for(int ctr=0; ctr<5; ctr++){
print(ctr);
}
● Iterable classes such as List and
Set also support the for-in form of
iteration
var cities=['Kolkata','Bangalore'];
for(var city in cities){
print(city);
}
switch case
● Switch statements compare integer, string, or compile-time constants
● Enumerated types work well in switch statements
● Supports empty case clauses, allowing a form of fall-through
var window_state = 'Closing';
switch(window_state){
case 'Opening' : print('Window is opening');
Break;
case 'Closing' : print('Window is Closing');
break;
default:print(“Non of the options”);
Functions in
Implementing a function
● Syntax
Return_type function function_name(parameters_list){
Function body;
}
● Eg:
Bool isOne(int a){
if(a==0){
return 0;
}
return 1;
}
Lambda function
● Syntax
[return_type]function_name(parameters)=>expression;
● Eg:
printMsg()=>print("hello");
int test()=>1234;
Parameters types
● Named Parameters
● Optional Parameters
● Default Parameters
Named Parameters
● eg:
Function definition :
void enableFlags({bool bold, bool hidden}) {...}
Function call:
enableFlags(bold: true, hidden: false);
Optional Parameters
● Wrapping a set of function parameters in [ ] marks them as optional positional
parameters:
● Eg:
Function definition :
void enableFlags(bool bold, [bool hidden]) {...}
Default Parameters
● Your function can use = to define default values for both named and
positional parameters.
● The default values must be compile-time constants.
● default value is provided, the default value is null.
● Eg:
void enableFlags({bool bold = false, bool hidden = false}) {...}
Exceptions in
Exception
● Exceptions are errors indicating that something unexpected happened.
● When an Exception occurs the normal flow of the program is disrupted and
the program/Application terminates abnormally.
● Eg
var n=10~/0;
Output:
Error occured ZeroDivision.
The try / on / catch Blocks
● syntax
try {
// code that might throw an exception
}
on Exception1 {
// code for handling exception
}
catch Exception2 {
// code for handling exception
}finally {
// code that should always execute; irrespective of the exception
}
Example try / on / catch
● try {
res = 10 ~/ 0;
}
on IntegerDivisionByZeroException
{
print('Cannot divide by zero');
}
● try {
res = 10 ~/ 0;
}
catch(e) {
print(e);
}
Exceptions in dart
Throw
● The throw keyword is used to explicitly raise an exception.
● A raised exception should be handled to prevent the program from exiting
abruptly.
● The syntax for raising an exception explicitly is −
throw new Exception_name();
Eg : of Throws
main() {
try {
test_age(-2);
}
catch(e) {
print('Age cannot be negative');
}
}
void test_age(int age) {
if(age<0) {
throw new FormatException();
}
}
object oriented programming
concepts(oop)
OOPs (Object-Oriented Programming System)
● Object means a real-world entity such as a pen, chair, table, computer, watch,
etc.
● Object-Oriented Programming is a methodology or paradigm to design a
program using classes and objects.
● It simplifies software development and maintenance by providing some
concepts:-
○ Object
○ Class
○ Inheritance
○ Polymorphism
○ Abstraction
○ Encapsulation
Object
● Any entity that has state and behavior is known as an object. For example, a
chair, pen, table, keyboard, bike, etc. It can be physical or logical.
● An Object can be defined as an instance of a class.
● An object contains an address and takes up some space in memory.
● Objects can communicate without knowing the details of each other's data or
code.
● Example: A dog is an object because it has states like color, name, breed, etc.
as well as behaviors like wagging the tail, barking, eating, etc.
Class
● Collection of objects is called class. It is a logical entity.
● A class can also be defined as a blueprint from which you can create an
individual object. Class doesn't consume any space.
Inheritance
● When one object acquires all the properties and behaviors of a parent object,
it is known as inheritance.
● It provides code reusability.
● It is used to achieve runtime polymorphism.
● Types of inheritance:-
○ Single Inheritance
○ Multiple Inheritance
○ Hierarchical Inheritance
○ Multilevel Inheritance
○ Hybrid Inheritance (also known as Virtual Inheritance)
Polymorphism
● If one task is performed in different ways, it is known as polymorphism.
● For example: to convince the customer differently, to draw something, for
example, shape, triangle, rectangle, etc.
● Another example can be to speak something; for example, a cat speaks
meow, dog barks woof, etc.
Abstraction
● Hiding internal details and showing functionality is known as abstraction.
● For example phone call, we don't know the internal processing.
Encapsulation
● Binding (or wrapping) code and data together into a single unit are known as
encapsulation.
● For example, a capsule, it is wrapped with different medicines.
OOP in
Declaring a Class in dart
● Use the class keyword to declare a class in Dart.
● A class definition starts with the keyword class followed by the class name;
● The class body enclosed by a pair of curly braces.
● Syntax
class class_name {
<fields>
<getters/setters>
<constructors>
<functions>
}
A class definition can include the following −
● Fields − A field is any variable declared in a class. Fields represent data
pertaining to objects.
● Setters and Getters − Allows the program to initialize and retrieve the values
of the fields of a class. A default getter/ setter is associated with every class.
However, the default ones can be overridden by explicitly defining a setter/
getter.
●
Thank You..
PPT created by Vishnu Suresh

More Related Content

What's hot

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
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart languageJana Moudrá
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to FlutterApoorv Pandey
 
Getting started with flutter
Getting started with flutterGetting started with flutter
Getting started with flutterrihannakedy
 
Mobile development with Flutter
Mobile development with FlutterMobile development with Flutter
Mobile development with FlutterAwok
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1RubaNagarajan
 
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
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streamsbabak danyal
 
Building beautiful apps with Google flutter
Building beautiful apps with Google flutterBuilding beautiful apps with Google flutter
Building beautiful apps with Google flutterAhmed Abu Eldahab
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming languageSlawomir Dorzak
 

What's hot (20)

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
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart language
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to Flutter
 
Getting started with flutter
Getting started with flutterGetting started with flutter
Getting started with flutter
 
Flutter
FlutterFlutter
Flutter
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 
Flutter workshop
Flutter workshopFlutter workshop
Flutter workshop
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
 
Mobile development with Flutter
Mobile development with FlutterMobile development with Flutter
Mobile development with Flutter
 
interface in c#
interface in c#interface in c#
interface in c#
 
Data types in c++
Data types in c++Data types in c++
Data types in c++
 
Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
basics dart.pdf
basics dart.pdfbasics dart.pdf
basics dart.pdf
 
Flutter beyond hello world
Flutter beyond hello worldFlutter beyond hello world
Flutter beyond hello world
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1
 
Flutter
FlutterFlutter
Flutter
 
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?
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Building beautiful apps with Google flutter
Building beautiful apps with Google flutterBuilding beautiful apps with Google flutter
Building beautiful apps with Google flutter
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming language
 

Similar to Dart workshop

Washington Practitioners Significant Changes To Rpc 1.5
Washington Practitioners Significant Changes To Rpc 1.5Washington Practitioners Significant Changes To Rpc 1.5
Washington Practitioners Significant Changes To Rpc 1.5Oregon Law Practice Management
 
Paulo Freire Pedagpogia 1
Paulo Freire Pedagpogia 1Paulo Freire Pedagpogia 1
Paulo Freire Pedagpogia 1Alejandra Perez
 
Jerry Shea Resume And Addendum 5 2 09
Jerry  Shea Resume And Addendum 5 2 09Jerry  Shea Resume And Addendum 5 2 09
Jerry Shea Resume And Addendum 5 2 09gshea11
 
Majlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi Petang
Majlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi PetangMajlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi Petang
Majlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi PetangImsamad
 
Agapornis Mansos - www.criadourosudica.blogspot.com
Agapornis Mansos - www.criadourosudica.blogspot.comAgapornis Mansos - www.criadourosudica.blogspot.com
Agapornis Mansos - www.criadourosudica.blogspot.comAntonio Silva
 
Dr Mrs A A Miraje C Programming PPT.pptx
Dr Mrs A A Miraje C Programming PPT.pptxDr Mrs A A Miraje C Programming PPT.pptx
Dr Mrs A A Miraje C Programming PPT.pptxProfAAMiraje
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scaladatamantra
 
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...Jitendra Bafna
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing TutorialMahira Banu
 
Meetup C++ A brief overview of c++17
Meetup C++  A brief overview of c++17Meetup C++  A brief overview of c++17
Meetup C++ A brief overview of c++17Daniel Eriksson
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2ndConnex
 
02 functions, variables, basic input and output of c++
02   functions, variables, basic input and output of c++02   functions, variables, basic input and output of c++
02 functions, variables, basic input and output of c++Manzoor ALam
 

Similar to Dart workshop (20)

Programming basics
Programming basicsProgramming basics
Programming basics
 
Python ppt
Python pptPython ppt
Python ppt
 
MMBJ Shanzhai Culture
MMBJ Shanzhai CultureMMBJ Shanzhai Culture
MMBJ Shanzhai Culture
 
Washington Practitioners Significant Changes To Rpc 1.5
Washington Practitioners Significant Changes To Rpc 1.5Washington Practitioners Significant Changes To Rpc 1.5
Washington Practitioners Significant Changes To Rpc 1.5
 
Paulo Freire Pedagpogia 1
Paulo Freire Pedagpogia 1Paulo Freire Pedagpogia 1
Paulo Freire Pedagpogia 1
 
Jerry Shea Resume And Addendum 5 2 09
Jerry  Shea Resume And Addendum 5 2 09Jerry  Shea Resume And Addendum 5 2 09
Jerry Shea Resume And Addendum 5 2 09
 
LoteríA Correcta
LoteríA CorrectaLoteríA Correcta
LoteríA Correcta
 
Majlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi Petang
Majlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi PetangMajlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi Petang
Majlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi Petang
 
Agapornis Mansos - www.criadourosudica.blogspot.com
Agapornis Mansos - www.criadourosudica.blogspot.comAgapornis Mansos - www.criadourosudica.blogspot.com
Agapornis Mansos - www.criadourosudica.blogspot.com
 
Dr Mrs A A Miraje C Programming PPT.pptx
Dr Mrs A A Miraje C Programming PPT.pptxDr Mrs A A Miraje C Programming PPT.pptx
Dr Mrs A A Miraje C Programming PPT.pptx
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
 
Cs3430 lecture 15
Cs3430 lecture 15Cs3430 lecture 15
Cs3430 lecture 15
 
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
Meetup C++ A brief overview of c++17
Meetup C++  A brief overview of c++17Meetup C++  A brief overview of c++17
Meetup C++ A brief overview of c++17
 
C++ theory
C++ theoryC++ theory
C++ theory
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2nd
 
02 functions, variables, basic input and output of c++
02   functions, variables, basic input and output of c++02   functions, variables, basic input and output of c++
02 functions, variables, basic input and output of c++
 
Oops lecture 1
Oops lecture 1Oops lecture 1
Oops lecture 1
 
Software Developer Training
Software Developer TrainingSoftware Developer Training
Software Developer Training
 

Recently uploaded

Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...Elena Simperl
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...Product School
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 

Recently uploaded (20)

Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 

Dart workshop

  • 1.
  • 2.
  • 4. Dart Programming Language ● Open-Source General-Purpose programming language. ● Developed by Google. ● This meant for the server as well as the browser. ● an object-oriented language. ● C-style syntax.
  • 5. Designed By Lars Bak and Kasper Lund
  • 6. Why Dart? Help app developers write complex, high fidelity client apps for the modern web.
  • 8. Where Dart Using? ● Flutter Created on top of Dart. ● Flutter has an Power Full Engine to perform smooth and lag less performance. ● Flutter used for:
  • 10. First Dart Program // Entry point to Dart program main() { print('Hello from Dart'); } • main() - The special, required, top-level function where app execution starts. • Every app must have a top-level main() function, which serves as the entry point to the app.
  • 11. Comments In Dart • Dart supports both single line and multi line comments // Single line comment /* This is an example of multi line comment */
  • 12. Built in Types • number • int - Integer (range -253 to 253) • double - 64-bit (double-precision) • string • boolean – true and false • symbol • Collections • list (arrays) • map • set • runes (for expressing Unicode characters in a string)
  • 13. Variable Initializing ● var name=”technoship”; ● var reg=123; var keyword used to create static variables. ● dynamic name=”technoship”; ● dynamic reg=123; dynamic keyword used to create dynamic variables. ● String name=”technoship”; ● int reg=123; Variables can initialize using its data type.
  • 14. List and Map ● List List names=<String>[“Arun”,”Alen”]; List is used to store same data type items ● Map Map rollno_name=<int,String>{1:”Arun”,2:”Alen”}; Map is an object that associates keys and values
  • 15. String Interpolation ● Identifiers could be added within a string literal using $identifier or $varaiable_name syntax. var user = 'Bill'; var city = 'Bangalore'; print("Hello $user. Are you from $city?"); // prints Hello Bill. Are you from Bangalore? ● You can put the value of an expression inside a string by using ${expression} print('3 + 5 = ${3 + 5}'); // prints 3 + 5 = 8
  • 17. Operands and operator ● An expression is a special kind of statement that evaluates to a value. ● Every expression is composed of − ○ Operands − Represents the data ○ Operator − Defines how the operands will be processed to produce a value. ● Consider the following expression – "2 + 3". In this expression, 2 and 3 are operands and the symbol "+" (plus) is the operator.
  • 18. operators that are available in Dart. ● Arithmetic Operators ● Equality and Relational Operators ● Type test Operators ● Bitwise Operators ● Assignment Operators ● Logical Operators
  • 27. Control flow statements ● if and else ● for loops (for and for in) ● while and do while loops ● break and continue ● switch and case
  • 28. if and else ● if and else var age = 17; if(age >= 18){ print('you can vote'); } else{ print('you can not vote'); } ● curly braces { } could be omitted when the blocks have a single line of code
  • 29. Conditional Expressions ● Dart has two operators that let you evaluate expressions that might otherwise require ifelse statements − ○ condition ? expr1 : expr2 ● If condition is true, then the expression evaluates expr1 (and returns its value); otherwise, it evaluates and returns the value of expr2. ● Eg: ○ var res = 10 > 12 ? "greater than 10":"lesser than or equal to 10"; ● expr1 ?? expr2 ● If expr1 is non-null, returns its value; otherwise, evaluates and returns the value of expr2
  • 30. else if ● Supports else if as expected var income = 75; if (income <= 50){ print('tax rate is 10%'); } else if(income >50 && income <80){ print('tax rate is 20%'); } else{ print('tax rate is 30%'); }
  • 31. While & do..while ● While in dart var num=0; while(num<5){ print(num); i=i+1; } ● do..while in dart var num=0; do{ print(num); i=i+1; }while(num<5);
  • 32. for loops ● Supports standard for loop (as supported by other languages that follow C like syntax) for(int ctr=0; ctr<5; ctr++){ print(ctr); } ● Iterable classes such as List and Set also support the for-in form of iteration var cities=['Kolkata','Bangalore']; for(var city in cities){ print(city); }
  • 33. switch case ● Switch statements compare integer, string, or compile-time constants ● Enumerated types work well in switch statements ● Supports empty case clauses, allowing a form of fall-through var window_state = 'Closing'; switch(window_state){ case 'Opening' : print('Window is opening'); Break; case 'Closing' : print('Window is Closing'); break; default:print(“Non of the options”);
  • 35. Implementing a function ● Syntax Return_type function function_name(parameters_list){ Function body; } ● Eg: Bool isOne(int a){ if(a==0){ return 0; } return 1; }
  • 37. Parameters types ● Named Parameters ● Optional Parameters ● Default Parameters
  • 38. Named Parameters ● eg: Function definition : void enableFlags({bool bold, bool hidden}) {...} Function call: enableFlags(bold: true, hidden: false);
  • 39. Optional Parameters ● Wrapping a set of function parameters in [ ] marks them as optional positional parameters: ● Eg: Function definition : void enableFlags(bool bold, [bool hidden]) {...}
  • 40. Default Parameters ● Your function can use = to define default values for both named and positional parameters. ● The default values must be compile-time constants. ● default value is provided, the default value is null. ● Eg: void enableFlags({bool bold = false, bool hidden = false}) {...}
  • 42. Exception ● Exceptions are errors indicating that something unexpected happened. ● When an Exception occurs the normal flow of the program is disrupted and the program/Application terminates abnormally. ● Eg var n=10~/0; Output: Error occured ZeroDivision.
  • 43. The try / on / catch Blocks ● syntax try { // code that might throw an exception } on Exception1 { // code for handling exception } catch Exception2 { // code for handling exception }finally { // code that should always execute; irrespective of the exception }
  • 44. Example try / on / catch ● try { res = 10 ~/ 0; } on IntegerDivisionByZeroException { print('Cannot divide by zero'); } ● try { res = 10 ~/ 0; } catch(e) { print(e); }
  • 46. Throw ● The throw keyword is used to explicitly raise an exception. ● A raised exception should be handled to prevent the program from exiting abruptly. ● The syntax for raising an exception explicitly is − throw new Exception_name();
  • 47. Eg : of Throws main() { try { test_age(-2); } catch(e) { print('Age cannot be negative'); } } void test_age(int age) { if(age<0) { throw new FormatException(); } }
  • 49. OOPs (Object-Oriented Programming System) ● Object means a real-world entity such as a pen, chair, table, computer, watch, etc. ● Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. ● It simplifies software development and maintenance by providing some concepts:- ○ Object ○ Class ○ Inheritance ○ Polymorphism ○ Abstraction ○ Encapsulation
  • 50.
  • 51. Object ● Any entity that has state and behavior is known as an object. For example, a chair, pen, table, keyboard, bike, etc. It can be physical or logical. ● An Object can be defined as an instance of a class. ● An object contains an address and takes up some space in memory. ● Objects can communicate without knowing the details of each other's data or code. ● Example: A dog is an object because it has states like color, name, breed, etc. as well as behaviors like wagging the tail, barking, eating, etc.
  • 52. Class ● Collection of objects is called class. It is a logical entity. ● A class can also be defined as a blueprint from which you can create an individual object. Class doesn't consume any space.
  • 53. Inheritance ● When one object acquires all the properties and behaviors of a parent object, it is known as inheritance. ● It provides code reusability. ● It is used to achieve runtime polymorphism. ● Types of inheritance:- ○ Single Inheritance ○ Multiple Inheritance ○ Hierarchical Inheritance ○ Multilevel Inheritance ○ Hybrid Inheritance (also known as Virtual Inheritance)
  • 54.
  • 55. Polymorphism ● If one task is performed in different ways, it is known as polymorphism. ● For example: to convince the customer differently, to draw something, for example, shape, triangle, rectangle, etc. ● Another example can be to speak something; for example, a cat speaks meow, dog barks woof, etc.
  • 56. Abstraction ● Hiding internal details and showing functionality is known as abstraction. ● For example phone call, we don't know the internal processing.
  • 57. Encapsulation ● Binding (or wrapping) code and data together into a single unit are known as encapsulation. ● For example, a capsule, it is wrapped with different medicines.
  • 59. Declaring a Class in dart ● Use the class keyword to declare a class in Dart. ● A class definition starts with the keyword class followed by the class name; ● The class body enclosed by a pair of curly braces. ● Syntax class class_name { <fields> <getters/setters> <constructors> <functions> }
  • 60. A class definition can include the following − ● Fields − A field is any variable declared in a class. Fields represent data pertaining to objects. ● Setters and Getters − Allows the program to initialize and retrieve the values of the fields of a class. A default getter/ setter is associated with every class. However, the default ones can be overridden by explicitly defining a setter/ getter. ●
  • 61. Thank You.. PPT created by Vishnu Suresh