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

Introduction To DART

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 21

Mobile Application Development

Introduction to DART
• Flutter Works on Dart
• Programming Language Originally Developed
by Google
• Object Oriented (like C++ and Java)
• Class defined language using a C Style Syntax
• Faster, Smoother, Pretty efficient to be used
for developing applications websites and
server side applications
What makes Dart Versatile
• It compiles in its own format,
• But also compiles into Java Script which is
readable by most devices
• Can be used to make Cross-platform
applications, web applications using Angular
Dart and Command Line applications or server
side applications.
DART is not JUST language
• It Includes
– Libraries
– Tools
– VM
– Compiler to Java Script
– Dart SDK (written mostly in Dart)
– Dart VM is critical part of SDK
Dart Libraries
• Dart:Core
– Provide critical functionality by Dart
– It becomes part of every Dart program automatically
– Includes numbers,collections and strings
• Dart:Async
– Provides Asynchronous Programming
– Generally Uses Callback Functions.
– Alternative to Callback Functions is Future and
Streams
Dart Libraries
• Dart:Math
– Provide common mathematical and trigonometric
Functions
– Such as Sine Cosine , Maximum and Minimum
– Constant Such as Pi, exponentials
• Dart: Convert
– Has Converters for JSON and UTF-8 format Data
– Support for creating additional customized
converters.
Dart Libraries
• Dart:io
– Provides APIs to deal with files, directories,
processes, sockets, Web Sockets, and HTTP clients
and Servers,
• Dart:HTML
– Enables programming for browsers
– Allow manipulations of objects and elements in
DOM and gives access to HTML5 APIs.
Dart Libraries
• Dart:UI
– Exposes the lowest-level services that flutters
framework use to bootstrap applications, such as
classes for driving the input, graphics text, layout
and rending subsystems.

Dart Tools

• Insatall Dart SDK


– For Web Developers
– For Script and Server
• Install Flutter SDK
– For Mobile Developers
• IDEs and Editors.(Following IDEs support Dart )
– Android Studio
– VSCode
– InelliJ
• Note that atom, vim and emacs are not supported by Dart
officially but are available as open source plugins.
• DartPad
– Is an online dart compiler which lets you play around with dart.
– https://dartpad.dartlang.org/
• Command Line tools
– Pub package Manager
• Helps in managing packages and distributes them through different
repositories.
– Static analyzer
• Evaluates and reports any errors or warning in your code
– Code Formatter
• Formats your code
Dart VM
• Dart VM borrowed from JavaScript VM used by chrome called
V8
• But browsers actively rejected it reasons being size,
• Dart VM works in the background during the process of
applications building.
• Run in two basis Modes
– JIT (Just in Time)
• Used for dynamically loading Dart source, parsing it and compiling it to
native machine code on the the fly to execute it.
• Used for debugging and hot reload.
– AOT (Ahead of Time)
• Used to support loading and Execution of precompiled machine code. Does
not support dynamic loading parsing or compilation
Dart VM
• Its Included in DART SDK
• How to Use
– All you have to do is type $dart and file name
– $dart filename.dart
• Includes the observatory options (to enable
asserts that checks a Boolean condition.
– $dart –enable-assert test.dart
• Note
– Dart VM cant be used for Mobile App or web Apps
Compiler to JS
• Dart code is compiled into java Script using dart2js or
dartdevc tool included in Dart.
• Dart2js
– Using dart2js a user can compile a dart file by converting it to
Java Script format.
• Dartdevc
– DARDEVC lets you run and debug your dart web app in any
modern web browser and is used for development by dart.

• Note Dartdevc compiler is only for development


• User dart2js for deployment.
Features of Dart
• Easier Animation and Transitions (is twice the time faster
than other languages)

• Package system
• Simple Syntax
• Semantics and Proper Behavior
– No undefined data
– E.g an index out range error for an array is displayed
comprehensibly, proper use of this pointer

•Lets Install Dart.
Install VS Code
• https://code.visualstudio.com
• Installing Dart SDK

–Dartlang.org
•Dart.dev
–https://dart.dev/get-dart

You might also like