App Development PPT 1
App Development PPT 1
❏Local Environments:
❏https://gekorm.com/dart-windows
❏https://www.jetbrains.com/idea/download
Dart in VSCode
❏Local Environments:
❏https://gekorm.com/dart-windows
❏https://www.jetbrains.com/idea/download
Dart Syntax
• 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
• 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
10 + 20
Operand Operator Operand
● 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.