Flutter & dart SDK
Flutter & dart SDK
▲▼▲▼▲▼
tags : #flutter #coding
references : Flutter
▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼
▲▼▲▼▲▼
1. Dart SDK:
Purpose: The Dart SDK provides everything needed to write, compile, and run Dart code. It
includes the Dart language, its libraries, the Dart Virtual Machine (VM), and tools like
compilers for various platforms.
Use Cases:
Standalone Dart applications (console apps, server-side code, etc.)
Web applications (through Dart-to-JavaScript compilation using dart2js )
Command-line tools and libraries
Key Tools Included:
dart command-line tool: To run Dart code, check dependencies, etc.
Dart libraries: Core libraries for common tasks like collections, HTTP, I/O, etc.
Dart compiler ( dart2js , dart2native )
Standalone Use: The Dart SDK can be used independently for non-Flutter applications.
You can write applications in Dart and run them using the Dart VM or compile them into
JavaScript or native machine code.
2. Flutter SDK:
Purpose: The Flutter SDK is a framework that provides tools for building cross-platform
mobile, web, and desktop apps using Dart. It includes everything from the Dart SDK (so
you get Dart tools too) and adds Flutter-specific libraries and tools for building UIs and
interacting with the native device APIs.
Use Cases:
Building mobile apps (iOS and Android) with a single codebase
Creating web applications (using the same codebase as mobile apps)
Desktop apps (macOS, Windows, Linux) via Flutter
Key Tools Included:
Flutter framework: Widgets, UI components, and APIs for building apps
Flutter tooling: Commands to run, test, and deploy Flutter apps ( flutter command)
Dart SDK: The Dart SDK is bundled with the Flutter SDK because Flutter apps are
written in Dart.
Flutter Engine: Handles rendering and platform-specific interactions for apps
Standalone Use: The Flutter SDK is specifically for building cross-platform applications. It’s
not for running general Dart code or building command-line tools. If you're working on
mobile or cross-platform apps, you use Flutter.
Key Differences:
Relationship:
Flutter SDK includes Dart SDK: Since Flutter is built using Dart, the Flutter SDK bundles
the Dart SDK with it. If you install the Flutter SDK, you get both Flutter tools and Dart SDK
tools.
Dart SDK alone: You can use Dart independently to write applications (without Flutter). This
is often used for backend services, command-line applications, or other types of non-UI
programs.
Example Workflow:
With Flutter: You write UI code using Flutter’s rich widget set, and the code is written in
Dart. The Flutter SDK takes care of everything you need to build and run the app.
With Dart: You can write server-side applications, or use Dart for scripts, algorithms, or
anything that doesn’t require the Flutter framework.