Introduction
- ⇒ Made by Google
- ⇒ Object Oriented
- ⇒ Single Threaded
- ⇒ Open Source
- ⇒ Dart Native for mobile, command-line, server-side
- ⇒ Dart Web for web apps
.
- ⇒ Type System
- ⇒ Classes (Single inheritance)
- ⇒ Interfaces (Multiple interfaces)
- ⇒ Concurrency (with isolates)
- ⇒ Collections (Heterogeneous by default)
- ⇒ Generics
- ⇒ Optional Typing
- ⇒ Async Await
- ⇒ Productive development (Hot reloading)
.
Tools
- ⇒ SDK (Dart SDK, Dart For Windows)
- ⇒ DartPad – Online Editor
- ⇒ Text Editors (Notepad, Emacs, vim or vi etc)
- ⇒ IDE’s (Eclipse, IntelliJ, WebStorm, VS Code etc)
- ⇒ Flutter framework (powered by Dart Web) -multi-platform UI toolkit
- ⇒ AngularDart (powered by Dart Web)
- ⇒ dartanalyzer, for static analysis
- ⇒ dartfmt, for code formatting
- ⇒ pub, the dart package manager
.
Compilers
- ⇒ dart2aot, dart to native x64 machine code
- ⇒ dartdevc (development time compiler), used only for web dev
- ⇒ dart2js (production time compiler), dart to javascript
.
Command Line
> Hello World !! .
Data Manipulation
Type Conversion
.
Definite Loop
for loop
.
Definite Loop
for-in loop
.
Indefinite Loop
while loop
.
Indefinite Loop
do-while loop
.
break statement: Take the control out of a construct
.
continue statement: Skip a statement in the iteration
Functions
Classes & Objects
Class Inheritance lets us create new classes (child/sub classes) from an existing class (base/parent/super class).
.
Variables And Data Types
Indentifiers & Operators
Identifiers are names given to elements in a program like variables, functions etc.
.
Variables And Data Types
Data Types
Numbers in Dart
.
String is a sequence of UTF-16 code units
.
Booleans in Dart
.
– A rune is simply an integer representing the Unicode code point.
.
Enums are used for defining named constant values
.Collection
In Dart, Array is represented in the form of a List
.
A Map is a dynamic collection of key value pairs.
.
Useful for first-in, first-out collection
.More
If you never intend to change a variable, use final or const.
– final variable can be set only once
– const variable is a compile-time constant (implicit final)
.
Dart built-int exceptions:
⇒ IntegerDivisionByZeroException: When a number is divided by zero.
⇒ IOException: Base class for all Inupt-Output related exceptions.
⇒ DeferredLoadException : Thrown when a deferred library fails to load.
⇒ FormatException: Thrown when a string or some other data does not have an expected format and cannot be parsed or processed
⇒ IsolateSpawnException: Thrown when an isolate cannot be created.
⇒ Timeout: Thrown when a scheduled timeout happens while waiting for an async result
.A function-type alias which can be used as pointer to specify a function signature that we want specific functions to match.
.A means for getting a value sometime in the future.
.