SlideShare a Scribd company logo
CHAPTER 2 FLUTTER BASICS LECTURE 1
INTRODUCTION TO FLUTTER AND DART PROGRAMING LANGUAGE
INTRODUCTION TO FLUTTER
 Flutter is an open source framework to create high quality, high performance
mobile applications across mobile operating systems - Android and iOS. It
provides a simple, powerful, efficient and easy to understand SDK to write
mobile application in Google’s own language, Dart.
 Flutter also offers many ready to use widgets (UI) to create a modern
application. These widgets are optimized for mobile environment and
designing the application using widgets is as simple as designing HTML.
FEATURES OF FLUTTER
 Flutter framework offers the following features to developers:
 Modern and reactive framework.
 Uses Dart programming language and it is very easy to learn.
 Fast development.
 Beautiful user interfaces.
 Huge widget catalog.
 Runs same UI for multiple platforms.
 High performance application.
ADVANTAGES OF FLUTTER
Flutter comes with beautiful and customizable widgets for high performance
and outstanding mobile application. It fulfills all the custom needs and
requirements. Besides these, Flutter offers many more advantages as mentioned
below:
 Dart has a large repository of software packages which lets you to extend the
capabilities of your application.
 Developers need to write just a single code base for both applications (both
Android and iOS platforms). Flutter may to be extended to other platform as well
in the future.
CONT..
 Flutter needs lesser testing. Because of its single code base, it is sufficient if
we write automated tests once for both the platforms.
 Flutter’s simplicity makes it a good candidate for fast development. Its
customization capability and extendibility makes it even more powerful.
 With Flutter, developers has full control over the widgets and its layout.
 Flutter offers great developer tools, with amazing hot reload.
DISADVANTAGES OF FLUTTER
Despite its many advantages, flutter has the following drawbacks in it:
 Since it is coded in Dart language, a developer needs to learn new language (though
it is easy to learn).
 Modern framework tries to separate logic and UI as much as possible but, in Flutter,
user interface and logic is intermixed. We can overcome this using smart coding and
using high level module to separate user interface and logic.
 Flutter is yet another framework to create mobile application. Developers are having
a hard time in choosing the right development tools in hugely populated segment.
FLUTTER THE DART PROGRAMMING
Dart is an open-source general-purpose programming language. It is originally
developed by Google. Dart is an object-oriented language with C-style syntax. It
supports programming concepts like interfaces, classes, unlike other programming
languages Dart doesn’t support arrays. Dart collections can be used to replicate data
structures such as arrays, generics, and optional typing.
The following code shows a simple Dart program:
void main() {
print("Dart language is easy to learn");
}
VARIABLES AND DATA TYPES
 Variable is named storage location and Data types simply refers to the type and size
of data associated with variables and functions. Dart uses var keyword to declare the
variable.
 The syntax of var is defined below
 The final and const keyword are used to declare constants. They are defined as
below:
var name = 'Dart’;
void main() {
final a = 12;
const pi = 3.14;
print(a);
print(pi);
}
CONT..
Dart language supports the following data types:
 Numbers: It is used to represent numeric literals – Integer and Double.
 Strings: It represents a sequence of characters. String values are specified in either
single or double quotes.
 Booleans: Dart uses the bool keyword to represent Boolean values – true and false.
 Lists and Maps: It is used to represent a collection of objects.
A simple List can be defined as below: void main() {
var list = [1,2,3,4,5];
print(list);
}
CONT..
 The list shown above produces [1,2,3,4,5] list.
 Map can be defined as shown here:
 Dynamic: If the variable type is not defined, then its default type is dynamic. The
following example illustrates the dynamic type variable:
void main() {
var mapping = {'id': 1,'name':'Dart’};
print(mapping);
}
void main() {
dynamic name = "Dart";
print(name);
}
DART CONTROL FLOW STATEMENT
 The control statements or flow of control statements are used to control the flow
of Dart program. These statements are very important in any programming
languages to decide whether other statement will be executed or not. The code
statement generally runs in the sequential manner. We may require executing or
skipping some group of statements based on the given condition, jumps to another
statement, or repeat the execution of the statements.
 In Dart, control statement allows to smooth flow of the program. By using the control
flow statements, a Dart program can be altered, redirected, or repeated based on the
application logic.
CATEGORIES OF FLOW STATEMENT
In Dart, Control flow statement can be categorized mainly in three following
ways.
• Decision-making statements
• Looping statements
• Jump statements
DART DECISION-MAKING STATEMENTS
 The Decision-making statements allow us to
determine which statement to execute based on
the test expression at runtime. Decision-making
statements are also known as the Selection
statements. In Dart program, single or multiple
test expression (or condition) can be existed,
which evaluates Boolean TRUE and FALSE. These
results of the expression/condition helps to
decide which block of statement (s) will execute if
the given condition is TRUE or FALSE.
CONT..
Dart provides following types of Decision-making statement.
• If Statement
• If-else Statements
• If else if Statement
• Switch Case Statement
if (n<40){
print("The number is smaller than 40"
)
};
if(x > y){
print("x is greater than y");
} else {
print("y is greater than x");
};
if(marks > 85)
{
print("Excellent");
}
else if(marks>75)
{
print("Very Good");
}
else
{
print("Average");
}
switch (n) {
case 1:
print("Value is 1");
break;
default:
print("Out of range");
break;
DART LOOPING STATEMENTS
Dart looping statements are used to execute the block of code multiple-times for the
given number of time until it matches the given condition. These statements are also
called Iteration statement.
Dart provides following types of the looping statements.
 Dart for loop
 Dart for….in loop
 Dart while loop
 Dart do while loop
for(int i = 1; i < =10;i++
)
{
print(i);
}
var list1 = [10,20,30,40,50];
for(var i in list1) {
print(i);
}
int i = 1;
while (i <= 5)
{
print( i);
++i;
}
do{
print(i);
i++;
}while(i<=20);
print("The loop is terminated");
bool check;
check = 20>10;
print("The statement is = ${check}");
DART JUMP STATEMENTS
Jump statements are used to jump from another statement, or we can say that it
transfers the execution to another statement from the current statement.
Dart provides following types of jump statements -
 Dart Break Statement
 Dart Continue Statement
The above jump statements behave differently.
DART FUNCTION
 Dart function is a set of codes that together perform a specific task. It is used to
break the large code into smaller modules and reuse it when needed. Functions make
the program more readable and easy to debug. It improves the modular approach
and enhances the code reusability.
void main()
{
add(3,4);
}
void add(int a,int b)
{
int c;
c = a + b;
print(c);
}
ADVANTAGES OF FUNCTIONS
 The few benefits of the Dart function is given below.
 It increases the module approach to solve the problems.
 It enhances the re-usability of the program.
 We can do the coupling of the programs.
 It optimizes the code.
 It makes debugging easier.
 It makes development easy and creates less complexity.
DART OBJECT-ORIENTED CONCEPTS
Dart is an object-oriented programming language, and it supports all the concepts of
object-oriented programming such as classes, object, inheritance, mixin, and abstract
classes. As the name suggests, it focuses on the object and objects are the real-life entities.
The Object-oriented programming approach is used to implement the concept like
polymorphism, data-hiding, etc. The main goal of oops is to reduce programming
complexity and do several tasks simultaneously. The oops concepts are given below.
• Class
• Object
• Inheritance
• Polymorphism
• Interfaces
• Abstract class
CLASS
 Dart classes are defined as the blueprint of the associated objects. A Class is a user-
defined data type that describes the characteristics and behavior of it.
 To get all properties of the class, we must create an object of that class. The syntax of
the class is given below.
class ClassName {
<fields>
<getter/setter>
<constructor>
<functions>
}
OBJECT
 An object is a real-life entity such as a table, human, car, etc. The object has two
characteristics - state and behavior. Let's take an example of a car which has a name,
model name, price and behavior moving, stopping, etc. The object-oriented
programming offers to identify the state and behavior of the object.
 We can access the class properties by creating an object of that class. In Dart, The
object can be created by using a new keyword followed by class name. The syntax is
given below.
var objectName = new ClassName(<constructor_arguments>)
INHERITANCE
 Dart supports inheritance, which is used to create new classes from an existing class.
The class that to be extended is called parent /superclass, and the newly created class
is called child/subclass.
 Dart provides extends keyword to inherit the properties of parent class in child class.
The syntax is given below.
class child_class_name extends parent_class_name
POLYMORPHISM
 Polymorphism is an object-oriented programming concept where one thing has
many forms. It can be two types - Runtime polymorphism and Compile time
polymorphism.
 For example - A function has the same name but with a different behavior or class.
 Another example is the shape() class, and all the class inherited from the Rectangle,
Triangle, and circle.
INTERFACES
 The interface is defined as a blueprint of the class. We can declare methods and
variables inside the interface just like the class but in interface only abstract
declaration of methods is provided.
 We can only define the function signature but not its body.
 Another class can implement the interface. It is basically used for data-hiding.
ABSTRACT CLASS
 A class that contains one or more abstract method is called an abstract class. We can
declare the abstract class using the abstract keyword followed by class declaration.
The syntax is given below.
abstract class ClassName {
//Body of abstract class
}
END OF THE CHAPTER

More Related Content

What's hot

Introduction to kotlin
Introduction to kotlinIntroduction to kotlin
Introduction to kotlin
NAVER Engineering
 
Dart and Flutter Basics.pptx
Dart and Flutter Basics.pptxDart and Flutter Basics.pptx
Dart and Flutter Basics.pptx
DSCVSSUT
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
Bartosz Kosarzycki
 
Google flutter the easy and practical way
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical way
Ahmed Abu Eldahab
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
Võ Duy Tuấn
 
Dart programming language
Dart programming languageDart programming language
Dart programming language
Aniruddha Chakrabarti
 
Flutter presentation.pptx
Flutter presentation.pptxFlutter presentation.pptx
Flutter presentation.pptx
FalgunSorathiya
 
Flutter
FlutterFlutter
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
Vladimir Parfenov
 
Flutter vs React Native | Edureka
Flutter vs React Native | EdurekaFlutter vs React Native | Edureka
Flutter vs React Native | Edureka
Edureka!
 
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
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to Flutter
Apoorv Pandey
 
Introduction to flutter
Introduction to flutter Introduction to flutter
Introduction to flutter
Wan Muzaffar Wan Hashim
 
The magic of flutter
The magic of flutterThe magic of flutter
The magic of flutter
Shady Selim
 
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
 
Flutter beyond hello world
Flutter beyond hello worldFlutter beyond hello world
Flutter beyond hello world
Ahmed Abu Eldahab
 
A flight with Flutter
A flight with FlutterA flight with Flutter
A flight with Flutter
Ahmed Tarek
 
Flutter
Flutter Flutter
Flutter
Mohit Nainwal
 
Flutter session 01
Flutter session 01Flutter session 01
Flutter session 01
DSC IEM
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart language
Jana Moudrá
 

What's hot (20)

Introduction to kotlin
Introduction to kotlinIntroduction to kotlin
Introduction to kotlin
 
Dart and Flutter Basics.pptx
Dart and Flutter Basics.pptxDart and Flutter Basics.pptx
Dart and Flutter Basics.pptx
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
 
Google flutter the easy and practical way
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical way
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 
Dart programming language
Dart programming languageDart programming language
Dart programming language
 
Flutter presentation.pptx
Flutter presentation.pptxFlutter presentation.pptx
Flutter presentation.pptx
 
Flutter
FlutterFlutter
Flutter
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Flutter vs React Native | Edureka
Flutter vs React Native | EdurekaFlutter vs React Native | Edureka
Flutter vs React Native | Edureka
 
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?
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to Flutter
 
Introduction to flutter
Introduction to flutter Introduction to flutter
Introduction to flutter
 
The magic of flutter
The magic of flutterThe magic of flutter
The magic of 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?
 
Flutter beyond hello world
Flutter beyond hello worldFlutter beyond hello world
Flutter beyond hello world
 
A flight with Flutter
A flight with FlutterA flight with Flutter
A flight with Flutter
 
Flutter
Flutter Flutter
Flutter
 
Flutter session 01
Flutter session 01Flutter session 01
Flutter session 01
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart language
 

Similar to Chapter 2 Flutter Basics Lecture 1.pptx

pembelajaran tentang dart dalam bahasa inggris
pembelajaran tentang dart dalam bahasa inggrispembelajaran tentang dart dalam bahasa inggris
pembelajaran tentang dart dalam bahasa inggris
Reza120164
 
Dart PPT.pptx
Dart PPT.pptxDart PPT.pptx
Dart PPT.pptx
DSCMESCOE
 
Introduction of C++ By Pawan Thakur
Introduction of C++ By Pawan ThakurIntroduction of C++ By Pawan Thakur
Introduction of C++ By Pawan Thakur
Govt. P.G. College Dharamshala
 
Mobile Application Development class 002
Mobile Application Development class 002Mobile Application Development class 002
Mobile Application Development class 002
Dr. Mazin Mohamed alkathiri
 
unit 2.pptx
unit 2.pptxunit 2.pptx
unit 2.pptx
rrbornarecm
 
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
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
Amresh Raj
 
Oops lecture 1
Oops lecture 1Oops lecture 1
Oops lecture 1
rehan16091997
 
PRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdfPRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdf
jaymaraltamera
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 
Presentaion on Dart and Flutter Development.pptx
Presentaion on Dart and Flutter Development.pptxPresentaion on Dart and Flutter Development.pptx
Presentaion on Dart and Flutter Development.pptx
nitesh213757
 
Dart
DartDart
c#.pptx
c#.pptxc#.pptx
C programming course material
C programming course materialC programming course material
C programming course material
Ranjitha Murthy
 
Book management system
Book management systemBook management system
Book management system
SHARDA SHARAN
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
topu93
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
topu93
 
330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx
praxyvines
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
SURBHI SAROHA
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diary
SHARDA SHARAN
 

Similar to Chapter 2 Flutter Basics Lecture 1.pptx (20)

pembelajaran tentang dart dalam bahasa inggris
pembelajaran tentang dart dalam bahasa inggrispembelajaran tentang dart dalam bahasa inggris
pembelajaran tentang dart dalam bahasa inggris
 
Dart PPT.pptx
Dart PPT.pptxDart PPT.pptx
Dart PPT.pptx
 
Introduction of C++ By Pawan Thakur
Introduction of C++ By Pawan ThakurIntroduction of C++ By Pawan Thakur
Introduction of C++ By Pawan Thakur
 
Mobile Application Development class 002
Mobile Application Development class 002Mobile Application Development class 002
Mobile Application Development class 002
 
unit 2.pptx
unit 2.pptxunit 2.pptx
unit 2.pptx
 
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
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
Oops lecture 1
Oops lecture 1Oops lecture 1
Oops lecture 1
 
PRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdfPRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdf
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Presentaion on Dart and Flutter Development.pptx
Presentaion on Dart and Flutter Development.pptxPresentaion on Dart and Flutter Development.pptx
Presentaion on Dart and Flutter Development.pptx
 
Dart
DartDart
Dart
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
C programming course material
C programming course materialC programming course material
C programming course material
 
Book management system
Book management systemBook management system
Book management system
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
 
330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diary
 

Recently uploaded

Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 

Recently uploaded (20)

Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 

Chapter 2 Flutter Basics Lecture 1.pptx

  • 1. CHAPTER 2 FLUTTER BASICS LECTURE 1 INTRODUCTION TO FLUTTER AND DART PROGRAMING LANGUAGE
  • 2. INTRODUCTION TO FLUTTER  Flutter is an open source framework to create high quality, high performance mobile applications across mobile operating systems - Android and iOS. It provides a simple, powerful, efficient and easy to understand SDK to write mobile application in Google’s own language, Dart.  Flutter also offers many ready to use widgets (UI) to create a modern application. These widgets are optimized for mobile environment and designing the application using widgets is as simple as designing HTML.
  • 3. FEATURES OF FLUTTER  Flutter framework offers the following features to developers:  Modern and reactive framework.  Uses Dart programming language and it is very easy to learn.  Fast development.  Beautiful user interfaces.  Huge widget catalog.  Runs same UI for multiple platforms.  High performance application.
  • 4. ADVANTAGES OF FLUTTER Flutter comes with beautiful and customizable widgets for high performance and outstanding mobile application. It fulfills all the custom needs and requirements. Besides these, Flutter offers many more advantages as mentioned below:  Dart has a large repository of software packages which lets you to extend the capabilities of your application.  Developers need to write just a single code base for both applications (both Android and iOS platforms). Flutter may to be extended to other platform as well in the future.
  • 5. CONT..  Flutter needs lesser testing. Because of its single code base, it is sufficient if we write automated tests once for both the platforms.  Flutter’s simplicity makes it a good candidate for fast development. Its customization capability and extendibility makes it even more powerful.  With Flutter, developers has full control over the widgets and its layout.  Flutter offers great developer tools, with amazing hot reload.
  • 6. DISADVANTAGES OF FLUTTER Despite its many advantages, flutter has the following drawbacks in it:  Since it is coded in Dart language, a developer needs to learn new language (though it is easy to learn).  Modern framework tries to separate logic and UI as much as possible but, in Flutter, user interface and logic is intermixed. We can overcome this using smart coding and using high level module to separate user interface and logic.  Flutter is yet another framework to create mobile application. Developers are having a hard time in choosing the right development tools in hugely populated segment.
  • 7. FLUTTER THE DART PROGRAMMING Dart is an open-source general-purpose programming language. It is originally developed by Google. Dart is an object-oriented language with C-style syntax. It supports programming concepts like interfaces, classes, unlike other programming languages Dart doesn’t support arrays. Dart collections can be used to replicate data structures such as arrays, generics, and optional typing. The following code shows a simple Dart program: void main() { print("Dart language is easy to learn"); }
  • 8. VARIABLES AND DATA TYPES  Variable is named storage location and Data types simply refers to the type and size of data associated with variables and functions. Dart uses var keyword to declare the variable.  The syntax of var is defined below  The final and const keyword are used to declare constants. They are defined as below: var name = 'Dart’; void main() { final a = 12; const pi = 3.14; print(a); print(pi); }
  • 9. CONT.. Dart language supports the following data types:  Numbers: It is used to represent numeric literals – Integer and Double.  Strings: It represents a sequence of characters. String values are specified in either single or double quotes.  Booleans: Dart uses the bool keyword to represent Boolean values – true and false.  Lists and Maps: It is used to represent a collection of objects. A simple List can be defined as below: void main() { var list = [1,2,3,4,5]; print(list); }
  • 10. CONT..  The list shown above produces [1,2,3,4,5] list.  Map can be defined as shown here:  Dynamic: If the variable type is not defined, then its default type is dynamic. The following example illustrates the dynamic type variable: void main() { var mapping = {'id': 1,'name':'Dart’}; print(mapping); } void main() { dynamic name = "Dart"; print(name); }
  • 11. DART CONTROL FLOW STATEMENT  The control statements or flow of control statements are used to control the flow of Dart program. These statements are very important in any programming languages to decide whether other statement will be executed or not. The code statement generally runs in the sequential manner. We may require executing or skipping some group of statements based on the given condition, jumps to another statement, or repeat the execution of the statements.  In Dart, control statement allows to smooth flow of the program. By using the control flow statements, a Dart program can be altered, redirected, or repeated based on the application logic.
  • 12. CATEGORIES OF FLOW STATEMENT In Dart, Control flow statement can be categorized mainly in three following ways. • Decision-making statements • Looping statements • Jump statements
  • 13. DART DECISION-MAKING STATEMENTS  The Decision-making statements allow us to determine which statement to execute based on the test expression at runtime. Decision-making statements are also known as the Selection statements. In Dart program, single or multiple test expression (or condition) can be existed, which evaluates Boolean TRUE and FALSE. These results of the expression/condition helps to decide which block of statement (s) will execute if the given condition is TRUE or FALSE.
  • 14. CONT.. Dart provides following types of Decision-making statement. • If Statement • If-else Statements • If else if Statement • Switch Case Statement if (n<40){ print("The number is smaller than 40" ) }; if(x > y){ print("x is greater than y"); } else { print("y is greater than x"); }; if(marks > 85) { print("Excellent"); } else if(marks>75) { print("Very Good"); } else { print("Average"); } switch (n) { case 1: print("Value is 1"); break; default: print("Out of range"); break;
  • 15. DART LOOPING STATEMENTS Dart looping statements are used to execute the block of code multiple-times for the given number of time until it matches the given condition. These statements are also called Iteration statement. Dart provides following types of the looping statements.  Dart for loop  Dart for….in loop  Dart while loop  Dart do while loop for(int i = 1; i < =10;i++ ) { print(i); } var list1 = [10,20,30,40,50]; for(var i in list1) { print(i); } int i = 1; while (i <= 5) { print( i); ++i; } do{ print(i); i++; }while(i<=20); print("The loop is terminated"); bool check; check = 20>10; print("The statement is = ${check}");
  • 16. DART JUMP STATEMENTS Jump statements are used to jump from another statement, or we can say that it transfers the execution to another statement from the current statement. Dart provides following types of jump statements -  Dart Break Statement  Dart Continue Statement The above jump statements behave differently.
  • 17. DART FUNCTION  Dart function is a set of codes that together perform a specific task. It is used to break the large code into smaller modules and reuse it when needed. Functions make the program more readable and easy to debug. It improves the modular approach and enhances the code reusability. void main() { add(3,4); } void add(int a,int b) { int c; c = a + b; print(c); }
  • 18. ADVANTAGES OF FUNCTIONS  The few benefits of the Dart function is given below.  It increases the module approach to solve the problems.  It enhances the re-usability of the program.  We can do the coupling of the programs.  It optimizes the code.  It makes debugging easier.  It makes development easy and creates less complexity.
  • 19. DART OBJECT-ORIENTED CONCEPTS Dart is an object-oriented programming language, and it supports all the concepts of object-oriented programming such as classes, object, inheritance, mixin, and abstract classes. As the name suggests, it focuses on the object and objects are the real-life entities. The Object-oriented programming approach is used to implement the concept like polymorphism, data-hiding, etc. The main goal of oops is to reduce programming complexity and do several tasks simultaneously. The oops concepts are given below. • Class • Object • Inheritance • Polymorphism • Interfaces • Abstract class
  • 20. CLASS  Dart classes are defined as the blueprint of the associated objects. A Class is a user- defined data type that describes the characteristics and behavior of it.  To get all properties of the class, we must create an object of that class. The syntax of the class is given below. class ClassName { <fields> <getter/setter> <constructor> <functions> }
  • 21. OBJECT  An object is a real-life entity such as a table, human, car, etc. The object has two characteristics - state and behavior. Let's take an example of a car which has a name, model name, price and behavior moving, stopping, etc. The object-oriented programming offers to identify the state and behavior of the object.  We can access the class properties by creating an object of that class. In Dart, The object can be created by using a new keyword followed by class name. The syntax is given below. var objectName = new ClassName(<constructor_arguments>)
  • 22. INHERITANCE  Dart supports inheritance, which is used to create new classes from an existing class. The class that to be extended is called parent /superclass, and the newly created class is called child/subclass.  Dart provides extends keyword to inherit the properties of parent class in child class. The syntax is given below. class child_class_name extends parent_class_name
  • 23. POLYMORPHISM  Polymorphism is an object-oriented programming concept where one thing has many forms. It can be two types - Runtime polymorphism and Compile time polymorphism.  For example - A function has the same name but with a different behavior or class.  Another example is the shape() class, and all the class inherited from the Rectangle, Triangle, and circle.
  • 24. INTERFACES  The interface is defined as a blueprint of the class. We can declare methods and variables inside the interface just like the class but in interface only abstract declaration of methods is provided.  We can only define the function signature but not its body.  Another class can implement the interface. It is basically used for data-hiding.
  • 25. ABSTRACT CLASS  A class that contains one or more abstract method is called an abstract class. We can declare the abstract class using the abstract keyword followed by class declaration. The syntax is given below. abstract class ClassName { //Body of abstract class }
  • 26. END OF THE CHAPTER