Released · improving
Framework · Since 2017
Flutter is Google's open-source UI framework for building mobile, web and desktop apps from a single Dart codebase.
Flutter is an open-source UI framework from Google, first released in 2017. A single codebase can target Android, iOS, the web, Windows, macOS and Linux. Apps are written in Dart, Google's object-oriented language with syntax similar to Java and TypeScript, sound null safety and async/await; the Dart SDK ships with Flutter.
Instead of wrapping the platform's native UI controls, Flutter draws every pixel with its own rendering engine. That gives you consistent look and behavior across platforms and full freedom for custom designs and animations. Release builds compile Dart ahead of time to native machine code, and during development hot reload applies code changes instantly while keeping app state. This makes Flutter especially popular for mobile apps that must ship on several platforms at once.
To get started, install the Flutter SDK, check your setup with flutter doctor, and learn the widget model by modifying the counter app that flutter create generates. The official codelabs and the Dart language guide walk you through composing widgets, managing state and building layouts. Packages are found on pub.dev and added with flutter pub add.
Build Android, iOS, web, Windows, macOS and Linux apps from the same Dart code, adding platform-specific code only where needed.
Text, padding, layout and whole screens are all widgets, and complex UIs are built by composing small ones.
Code changes appear in the running app in about a second while its state is preserved, making UI iteration very fast.
Flutter's engine draws every pixel, and release builds are compiled ahead of time to machine code for smooth performance.
Install the Flutter extension in VS Code and let it download the SDK, or download the SDK for your OS from docs.flutter.dev, extract it and add its bin folder to your PATH. The Dart SDK is included.
Run flutter doctor to see whether the tooling for each target platform, such as Android Studio, Xcode, Chrome or Visual Studio, is installed. You only need the tools for the platforms you build for.
flutter doctorCreate a project with flutter create and run it on a connected device, emulator or browser. Saving code while it runs applies the change through hot reload.
flutter create hello_app && cd hello_app && flutter runEvery Flutter app starts at the main function in lib/main.dart, and the widget passed to runApp fills the screen. MaterialApp provides the skeleton of a Material Design app, Scaffold the basic layout of a screen, and Center and Text show a centered message. Replace the generated main.dart with this code and run it with flutter run.
lib/main.dart
import 'package:flutter/material.dart';
void main() {
runApp(
const MaterialApp(
home: Scaffold(
body: Center(child: Text('Hello, world!')),
),
),
);
}
flutter create hello_app && cd hello_app && flutter runSix chapters that take you from installation to the core ideas of Flutter.
Ask questions, share experience and trade opinions about Flutter.
No discussions yet. Start the first one.
0 comments
Sign in · Sign in to leave a comment.
Be the first to comment.