Dart Essentials
Vaibhav Bhapkar
@vaibhavbhapkar
-Power of
flutter
What is Dart?
Dart is a programming language designed for client
development, such as for the web and mobile apps. It is
developed by Google and can also be used to build server and
desktop applications.
Relation between Dart and
Flutter:
Dart is the programming language used to code Flutter apps.
Flutter is a framework.
A framework is a tool that provides ready-made components
or solutions that are customized in order to speed up
development.
Let’s Go…
Bohot hogya theory ab code karte hai
https://dartpad.dev/
How to become a Dart
programmer?
Hello World
Comments:
Comments can be used to explain Dart code, and to make it
more readable.
One line
// This is a normal, one-line comment.
Multi line
/* Comments like these are also supported. */
v
Variables
Variables are containers for storing data values.
SYNTAX: var variableName = value
v
Data Types
String
var name = 'name';
int, double, num
var year = 1977;
Booleans
var x = false;
v
Data Types
List
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune'];
map
var identifier = { key1:value1, key2:value2
[,…..,key_n:value_n] }
Conditional Statements:
●Use if to specify a block of code to be executed, if a specified
condition is true
●Use else to specify a block of code to be executed, if the same
condition is false
●Use else if to specify a new condition to test, if the first
condition is false
Operators in Dart:
The operators are special symbols that are used to carry out
certain operations on the operands.
● Arithmetic Operators : + , - , * , / , ~/ , %
● Assignment Operators : =, ??=
● Relational Operators : ==, > , < , >= , <=, !=
● Logical Operators : && , || , !
Conditional Statements:
if ( condition1 ){
// body of if
}
else if ( condition2 ){
// body of if
}
else {
// statement
}
Loops:
Looping statement in Dart or any other programming
language is used to repeat a certain set of commands until
certain conditions are not completed.
● for loop
● while loop
● do-while loop
for (int i = 0; i < 5; i++) {
print('Flutter');
}
while(condition){
text expression;
}
while loop
Loops:
do{
text expression;
}while(condition);
For loop
Do while loop
Function:
Functions are the building blocks of readable, maintainable, and
reusable code.
A function is a set of statements to perform a specific task.
Functions organize the program into logical blocks of code.
Function:
int add(int a, int b){
int result = a + b;
return result;
}
void main(){
var output = add(10, 20);
print(output);
}
Break
Dart – Object Oriented Programming:
In object-oriented programming, a class is a blueprint for
creating objects, providing initial values for state, and
implementations of behavior.
Class
An Object is an identifiable entity with some characteristics
and behaviour.
An Object is an instance of a Class.
Objects
Dart
class class_name {
// Body of class
}
Dart
class gdsc{
var name;
void func(){
print("Welcome to Flutter Festival $name");
}
}
void main()
{
gdsc member = new gdsc();
member.name = "kunal";
member.func();
}
Thank You!

Dart PPT.pptx

  • 1.
  • 2.
    What is Dart? Dartis a programming language designed for client development, such as for the web and mobile apps. It is developed by Google and can also be used to build server and desktop applications.
  • 3.
    Relation between Dartand Flutter: Dart is the programming language used to code Flutter apps. Flutter is a framework. A framework is a tool that provides ready-made components or solutions that are customized in order to speed up development.
  • 4.
    Let’s Go… Bohot hogyatheory ab code karte hai https://dartpad.dev/
  • 5.
    How to becomea Dart programmer?
  • 6.
  • 7.
    Comments: Comments can beused to explain Dart code, and to make it more readable. One line // This is a normal, one-line comment. Multi line /* Comments like these are also supported. */
  • 8.
    v Variables Variables are containersfor storing data values. SYNTAX: var variableName = value
  • 9.
    v Data Types String var name= 'name'; int, double, num var year = 1977; Booleans var x = false;
  • 10.
    v Data Types List var flybyObjects= ['Jupiter', 'Saturn', 'Uranus', 'Neptune']; map var identifier = { key1:value1, key2:value2 [,…..,key_n:value_n] }
  • 11.
    Conditional Statements: ●Use ifto specify a block of code to be executed, if a specified condition is true ●Use else to specify a block of code to be executed, if the same condition is false ●Use else if to specify a new condition to test, if the first condition is false
  • 12.
    Operators in Dart: Theoperators are special symbols that are used to carry out certain operations on the operands. ● Arithmetic Operators : + , - , * , / , ~/ , % ● Assignment Operators : =, ??= ● Relational Operators : ==, > , < , >= , <=, != ● Logical Operators : && , || , !
  • 13.
    Conditional Statements: if (condition1 ){ // body of if } else if ( condition2 ){ // body of if } else { // statement }
  • 14.
    Loops: Looping statement inDart or any other programming language is used to repeat a certain set of commands until certain conditions are not completed. ● for loop ● while loop ● do-while loop
  • 15.
    for (int i= 0; i < 5; i++) { print('Flutter'); } while(condition){ text expression; } while loop Loops: do{ text expression; }while(condition); For loop Do while loop
  • 16.
    Function: Functions are thebuilding blocks of readable, maintainable, and reusable code. A function is a set of statements to perform a specific task. Functions organize the program into logical blocks of code.
  • 17.
    Function: int add(int a,int b){ int result = a + b; return result; } void main(){ var output = add(10, 20); print(output); }
  • 18.
  • 19.
    Dart – ObjectOriented Programming: In object-oriented programming, a class is a blueprint for creating objects, providing initial values for state, and implementations of behavior. Class
  • 20.
    An Object isan identifiable entity with some characteristics and behaviour. An Object is an instance of a Class. Objects
  • 21.
  • 22.
    Dart class gdsc{ var name; voidfunc(){ print("Welcome to Flutter Festival $name"); } }
  • 23.
    void main() { gdsc member= new gdsc(); member.name = "kunal"; member.func(); }
  • 24.