0% found this document useful (0 votes)
7 views17 pages

App Development PPT 1

Uploaded by

1802007
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)
7 views17 pages

App Development PPT 1

Uploaded by

1802007
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/ 17

Smartphone Application Development

Dart Programming Language

Md. Moshiur Rahman


Dart

❏Core Of Flutter Framework


❏Programming Language like Java ,C# ,C++
❏Dart is a client-optimized programming language for apps on
multiple platforms.
❏It is developed by Google and is used to build mobile, desktop,
backend and web applications.
❏First appeared: October 10, 2011; 11 years ago
❏Designed by Lars Bak and Kasper Lund
Dart Environment

❏Online Environement: https://dartpad.dartlang.org

❏Local Environments:
❏https://gekorm.com/dart-windows
❏https://www.jetbrains.com/idea/download
Dart in VSCode

❏Youtube Tutorial: https://www.youtube.com/watch?v=1E1iz_qz-


HI

❏Local Environments:
❏https://gekorm.com/dart-windows
❏https://www.jetbrains.com/idea/download
Dart Syntax

Syntax is called set of rules for writing programs.


• Variables and Operators
• Classes
• Functions
• Expression and Programming Constructs
• Decision Making and Looping Constructs
• Comments
• Libraries and Packages
• Data structure represented as Collections / Generics
Dart Syntax

• Whitespace and Line Breaks


• Dart ignores spaces, tabs, and newlines that appear in the program.
• Dart is Case-sensitive
• Dart differentiates between uppercase and lowercase characters.
• Statements end with semicolon
• Each line of instruction is called a statement and a statement must end
with a semicolon
• Comments in Dart
• Single-line comments (//)
• Multi-line comments (/**/)
Dart Data Types

• Numbers
• Integer: Integer values represent non-fractional values
• Double: Fractional numeric values
• Strings
• A Dart String is a sequence of UTF-16 code units
• Boolean
• Boolean data types represents true and false
• Keyword: bool
• List
• List is an ordered group of objects.
• List is synonymous to the concept of array
• Map
• Map data type represents a set of value as key-value pair
Dart Variables

• A variable is a named space in the memory that stores values.


In other word variable is a container for the values in a
program
Dart Variables

• Keyword: dynamic
Dart Variables

• final vs const
• final: The final keyword is used to hardcode the values of the variable
and it cannot be altered in future, neither any kind of operations performed
on these variables can alter its value (state).
• const: The Const keyword in Dart behaves exactly like the final keyword.
The only difference between final and const is that the const makes the
variable constant from compile-time only. Using const on an object, makes
the object’s entire deep state strictly fixed at compile-time and that the
object with this state will be considered frozen and completely immutable.
Dart Variables

• Keyword: final
Dart Variables

• Keyword: const
Dart Operators

• Operands represents data


• Operators defines how the operands will be processed to produce a value

10 + 20
Operand Operator Operand

• Arithmetic Operators: +, -, *, /, %, ++, - -


• Relational Operators: <, >, <=, >=, ==, !=
• Assignment Operators: =, ??=, -=, +=, *=, /=, %=
• Logical Operators: &&, ||, !
Dart Data Type: String

• The String data type represents a sequence of characters


• A Dart string is a sequence of UTF 16 code units.
• String values in Dart can be represented using
• Single quotes
• Double quotes
• Triple quotes

• Single line strings are represented using single or double


quotes.
• Triple quotes are used to represent multi-line strings.
Dart Data Type: String

● String Concatenation
○ The + or += operator is used to merge the two string.
Dart Data Type: String

● String Interpolation
○ The string interpolation is a technique to manipulate the string
and create the new string by adding another value.
○ It can be used to evaluate the string including placeholders,
variables, and interpolated expression.
○ The ${expression} is used for string interpolation.
○ The expressions are replaced with their corresponding values.
Dart Data Type: String Methods
● toLowerCase(): It converts all characters of the given string in
lowercase.
● toUpperCase(): It converts all characters of the given string in
uppercase.
● trim(): It eliminates all whitespace from the given string.
● compareTo(): It compares one string from another.
● replaceAll(): It replaces all substring that matches the specified
pattern with a given string.
● split(): It splits the string at matches of the specified delimiter and
returns the list of the substring.
● substring(): It returns the substring from start index, inclusive to
end index.
● toString(): It returns the string representation of the given object.
● codeUnitAt(): It returns the 16-bits code unit at the given index.

You might also like