Dart
Dart
60
YOUR
UNDERSTANDING 40
20
0
Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Level 7
BEGINNER STAGE
Don’t Dive Deep When You Are
Beginner
DART
Environment Setup https://dartpad.dartlang.org
https://gekorm.com/dart-windows
https://www.jetbrains.com/idea/download
MY FIRST
Dart Program
Classes
Functions
Comments
Dart is Case-sensitive
Dart is case-sensitive. This means that Dart differentiates between uppercase and
lowercase characters
Comments in Dart
Single-line comments ( // ) Multi-line comments (/* */)
DART KEYWORDS
DART KEYWORDS
DART VARIABLE
Variable is used to store the value and refer the memory location in computer memory.
The variable cannot contain special characters such as whitespace, mathematical symbol, runes,
The first character of the variable should be an alphabet([A to Z],[a to z]). Digits are not allowed as the
first character.
Variables are case sensitive. For example, - variable age and AGE are treated differently.
The special character such as #, @, ^, &, * are not allowed expect the underscore(_) and the dollar
sign($).
Double
Double value represents the floating number
or number with the large decimal points.
DART STRING
A string is the sequence of the character. If we store the data like – name, address, special character, etc.
It is signified by using either single quotes or double quotes.
DART BOOLEAN
The Boolean type represents the two values - true and false.
The bool keyword uses to denote Boolean Type.
The numeric values 1 and 0 cannot be used to represent the true or false value.
DART LISTS
The list is a collection of the ordered objects (value). The concept of list is similar to an array.
The elements in the list are separated by the comma enclosed in the square bracket[].
DART MAPS
The maps type is used to store values in key-value pairs. Each key is associated with its value.
The key and value can be any type. In Map, the key must be unique, but a value can occur multiple times.
The Map is defined by using curly braces ({}), and comma separates each pair.
DART OPERATORS
(Arithmetic Operators)
DART OPERATORS
(Arithmetic Operators)
DART OPERATORS
(Unary Operators)
DART OPERATORS
(Unary Operators)
DART OPERATORS
(Assignment Operator)
DART OPERATORS
(Relational Operator)
DART OPERATORS
(Type Test Operators)
DART OPERATORS
(Logical Operators)
DART OPERATORS
(Bitwise Operators)
DART CONSTANTS
Dart Constant is defined as an immutable object
Which means it can't be changed or modified during the execution of the program.
Once we initialize the value to the constant variable, it cannot be reassigned later.
The size of the Grow able list can be modified at the runtime.
LIST INSERT
Dart provides four methods which are
used to insert the elements into the
lists. These methods are given below.
add()
addAll()
insert()
insertAll()
UPDATING LIST REMOVING LIST ELEMENTS
list_name[index] = new_value remove() removeAt() removeLast() removeRange()
DART SET
The Dart Set is the unordered collection of the
different values of the same type
Each value is associated with its key, and it is used to access its corresponding value.
In Dart Map, each key must be unique, but the same value can occur multiple times.
First, declare a map using map() constructor. Second, initialize the map.
MAP PROPERTIES
MAP METHODS
addAll() - It adds multiple key-value pairs of other. The syntax is given below.
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. Dart provides following types of Decision-making
statement.
If Statement
If-else Statements
If else if Statement
IF-ELSE STATEMENTS
In Dart, if-block is executed when the given condition is true. If the given condition is false, else-block is executed.
IF ELSE-IF STATEMENT
Dart if else-if statement provides the facility to check a set
of test expressions and execute the different statements.
It is used when we have to make a decision from more
than two possibilities.
CALLING A FUNCTION
After creating a function, we can call or invoke the defined function inside the main() function body
PASSING ARGUMENTS TO
FUNCTION
When a function is called, it may have some information as per
the function prototype is known as a parameter (argument).
FUNCTION RETURN & RETURN TYPE
It can be any data type such as void, integer, float, etc. The
return type must be matched with the returned value of the
function.
A function which is called itself again and again or recursively, then this process is called recursion
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.
Class
Object
Inheritance
Polymorphism
Interfaces
Abstract class
DART 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.
ACCESSING VARIABLE ACCESSING FUNCTION
FROM CLASS FROM CLASS
ACCESSING STATIC ACCESSING STATIC
VARIABLE FROM CLASS FUNCTION FROM CLASS
CLASS CONSTRUCTOR
A constructor is a different type of function which is created with same name as its class name.
The constructor is used to initialize an object when it is created.
programming approach).
Parent Class:
A class which is inherited by the other class is called
superclass or parent class. It is also known as a base
class.
Child Class:
A class which inherits properties from other class is called
the child class. It is also known as the derived class or
subclass.
METHOD OVERRIDING
When we declare the same method in the subclass, which is previously
The subclass can define the same method by providing its own
method.
abstract methods.
DART IMPORT CODE FORM EXTERNAL FILES
DART DEBUGGING
WHY DEBUGGING IS IMPORTANT
To improve my code