0% found this document useful (0 votes)
49 views21 pages

Chapter Two Introduction To Dart Programming

Chapter two fluter

Uploaded by

kaysecali32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views21 pages

Chapter Two Introduction To Dart Programming

Chapter two fluter

Uploaded by

kaysecali32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

GOLIS UNIVERSITY

Chapter One
Introduction To Dart Programming
Programs: Bachelor Degree of ICT & Software
Engineering
10/06/2025

Lecturer: Abdikarim Ali.


MBA,ICT & BBA of PM

1
Introduction To Dart Programming
Introduction To Dart
• Dart is an open-source general-purpose programming language
developed by Google.
• It supports application development on both the client and server
side.
• However, it is widely used for the development of Android apps,
iOS apps, IoT(Internet of Things), and web applications using
the Flutter Framework.
• Syntactically, Dart bears a strong resemblance to Java, C, and
JavaScript.
• It is a dynamic object-oriented language with closure and lexical
scope.
• The Dart language was released in 2011 but came into popularity
after 2015 with Dart 2.0
• Dart is the official language of Flutter, the UI toolkit for cross-
platform app development.
10/06/2025 3
Why We Use Dart
• Dart is a platform-independent language and supports all
operating systems such as Windows, Mac, Linux, etc.
• It is an open-source language, which means it available free for
everyone.
• It is an object-oriented programming language and supports all
features of oops such as inheritance, interfaces, and optional
type features.
• Perfect match with Flutter.
• Easy to learn for Java/C#/JavaScript developers.
• Great tooling with DartPad, VS Code, and Android Studio.
• Backed by Google with an active community.

10/06/2025 4
Features Dart
• Dart tools can report two types of problems while coding,
warnings and errors.
• Warnings are the indication that your code may have some
problem, but it doesn't interrupt the code's execution.
• whereas error can prevent the execution of code.

10/06/2025 5
DART COMMENTS

• In every programming language, comments play an important


role for a better understanding of the code in the future or by
any other programmer.
• Comments are a set of statements that are not meant to be
executed by the compiler.
• They provide proper documentation of the code.

10/06/2025 6
Types of Dart Comments
1. Dart single line comment is used to comment a line until
line break occurs.
• It is done using a double forward-slash (//).
2. Dart Multi-line comment is used to comment out a whole
section of code.
• It uses /* and */ to start and end a multi-line comment
respectively.
3. Dart Documentation Comments are a special type of
comment used to provide references to packages, software,
or projects.
• Dart supports two types of documentation comments: ///
(C# Style) and /** ... */ (JavaDoc Style). The /// for
Dart comments as many lines is /** used to mark it as
multi-line which makes it difficult to read the contents.
• Doc comments are recommended for writing public
APIs. 7
10/06/2025
DART VARIABLES
• A variable name is the name assigned to the memory location
where the user stores the data and that data can be fetched when
required with the help of the variable by calling its variable
name.
• There are two types of variable which will be used to store data
depending upon the type of data to be stored.
Conditions to Write Variable Name
• Conditions to write variable names or identifiers are as follows:
Variable names or identifiers can’t be the keyword.
Variable names or identifiers can’t contain alphabets and
numbers.
Variable names or identifiers can’t contain spaces and special
characters, except the underscore (_) and the dollar ($) sign.
Variable names or identifiers can’t begin with a number.
8

10/06/2025
TYPES OF VARIABLES
1. Static Variable
2. Dynamic Variable
3. constant

10/06/2025 9
Keywords in Dart
abstract continue new this as
false true final null default
throw finally do for try
catch get dynamic rethrow typedef
if else return var break
enum void int String double
bool list map implements set
switch case while static import
export in external this super
with class extends is const
yield factory

10/06/2025 10
STATIC VARIABLES

•A static variable is shared among all instances of a class.


•It is associated with the class rather than any specific object.
•The value of the static variable is stored in a fixed memory
location and is retained across different method calls or
instances.

10/06/2025 11
DYNAMIC VARIABLES

•A dynamic variable can hold values of any type and allows


its type to change at runtime.
•It is defined using the dynamic keyword.
•Be cautious when using dynamic as it bypasses compile-time
type checking.

10/06/2025 12
FINAL OR CONST VARIABLES

•A final variable can be assigned only once, and its value


cannot be modified after being initialized.
•It is initialized at runtime when accessed.
•A const variable is a compile-time constant, meaning its
value is determined during compilation.
•It cannot be changed and must be initialized with a constant
value.

10/06/2025 13
Dart Basics

•void main() {
•void main() {
String name = "Geedi";
print(“Hello World”);
int age = 20;
}
print(name);
print(age);
}

10/06/2025 14
VARIABLES

void main() { void main() {


String name = "Geedi"; // Declaring Variables
int age = 20; double price = 1130.2;
dynamic region = "Sanaag"; print(price);
print(region); }
print(name);
print(age);
}

10/06/2025 15
VARIABLES
dynamic Variable
Booleans Variable void main() {
void main() { dynamic name =
bool center = true; "Mohamed";
print(center); //name = 30;
} print(name);
Const Variable
void main() { }
const pi = 3.14;
const course = 'Dart';
//course = 100;
print(pi);
print(course);
}

10/06/2025 16
VARIABLES
void main() {
// Declaring Variables
double price = 1130.2;
print(price);
}

10/06/2025 17
Dart Data type
Data types help you to categorize all the different types of
data you use in your code. For e.g. numbers, texts,
symbols, etc.
The data type specifies what type of value will be stored by
the variable. Each variable has its data type.
Dart supports the following built-in data types :
1. Numbers
2. Strings
3. Booleans
4. Lists
5. Maps
6. Sets
7. Runes
8. Null

10/06/2025 18
Dart Data type
Data Type Keyword Description
Numbers int, double, num It represents numeric values

It represents a sequence of
Strings String
characters

It represents Boolean values true


Booleans bool
and false

Lists List It is an ordered group of items

It represents a set of values as


Maps Map
key-value pairs

It is an unordered list of unique


Sets Set
values of same types

It represents Unicode values of


Runes runes
String

Null null It represents null value

10/06/2025 19
10/06/2025 20
10/06/2025 21

You might also like