Bookmarks
ReferenceMobile developmentVerified

Flutter

Flutter is a Dart framework for Android, iOS, web and desktop apps from a single codebase. The reference covers: widgets, layout, state, navigation, publishing.

checked 1 Nov · next check 8 Nov · 53 min read

Sections
13
Reading
53 min
Current version
Flutter 3.47.9; Dart 3.13.7
Written from
docs.flutter.dev

Check status of the reference

Verified 1 Nov · next check 8 Nov

The sections were compared with the release notes, the check found nothing, and all source links respond.

  1. Verified
  2. Scheduled check

What Flutter is and how it is arranged

Flutter is an open-source Google framework for graphical interface apps in the Dart language. From one codebase it builds apps for Android, iOS, the web, Windows, macOS and Linux, and draws the screen itself with its own engine, without the system interface elements.

Flutter suits the case where one app has to ship on several platforms with the same look and behaviour: the Material and Cupertino widgets are written in Dart and do not depend on the OS version. A native component that makes no sense to rewrite — a map, a web view — is embedded as a platform view. Such an insert is continuously synchronised with the platform and costs performance, so an app made of native components alone is closer to native development.

Flutter is arranged in layers, and each layer relies only on the one beneath it. The app assembles the interface from the widgets of the framework, which is written in Dart: Material and Cupertino, basic widgets, layout and rendering, animation and gestures. Through the dart:ui library the framework talks to the engine written in C++: the engine rasterises frames through Impeller, lays out text and hosts the Dart runtime. The bottom layer is the embedder, written in the language of the platform: it starts the app, provides a surface for drawing, input and the event loop.

The framework libraries are stacked bottom up: each uses only the ones beneath it.

During development the code runs in the Dart VM: hot reload without losing state is built on this. In release, Dart code is ahead-of-time (AOT) compiled into ARM or x64 machine code, and for the web into JavaScript or WebAssembly. Code in Kotlin, Java, Swift and Objective-C is called through platform channels, C libraries through dart:ffi; ready-made wrappers over device APIs are published on pub.dev as plugins.

How Flutter differs from React Native and native development

FeatureFlutterReact NativeNatively: Compose, SwiftUI
LanguageDartJavaScript and ReactKotlin for Android, Swift for iOS
Who draws the interfaceits own Impeller engine, the system widgets are not usedthe system views of Android and iOS: React components turn into themthe UI framework of the platform itself
How the interface is describeddeclaratively: a widget treedeclaratively: React componentsdeclaratively: Compose composable functions, View structures in SwiftUI
Platforms from one codebaseAndroid, iOS, the web, Windows, macOS, LinuxAndroid and iOSone
Access to platform APIsplugins, platform channels, FFIfrom JavaScript and through its own native componentsdirectly

Choose Flutter when you need one codebase and the same interface on mobile, the web and desktop. Choose React Native when the team writes in React and the interface should consist of the system views. Choose native development when the app is made for a single platform and relies on its system components.

What to know in advance

  • Programming basics: variables, functions, classes. Dart itself is covered in the “Dart syntax” and “Asynchrony in Dart: Future, Stream and isolates” sections.
  • The command line and the PATH variable — the Bash reference.
  • HTTP requests and JSON for working with the network — the HTTP and REST reference.
  • Signing and the app store requirements — the “Android and Kotlin” and “iOS and Swift” references, the sections on publishing.

Section sources

the section is written from these pages

Cheat sheet

Everyday flutter commands, keys of a running app, Dart notation and layout widgets. Each row is covered in its own section; replace my_app, items and card with your own names.

Project setup and running

TaskCommand
Check the environmentflutter doctor
Accept the Android SDK licencesflutter doctor --android-licenses
Create a projectflutter create my_app
Create a project with a minimal main.dartflutter create --empty my_app
List connected devicesflutter devices
Run in debug modeflutter run
Run in Chromeflutter run -d chrome
Run for performance measurementsflutter run --profile
Run the analyser on the codeflutter analyze
Run the testsflutter test
Remove build/ and .dart_tool/flutter clean

Packages

TaskCommand
Add a package as a dependencyflutter pub add http
Add a development-only packageflutter pub add dev:build_runner
Fetch dependencies from pubspec.yamlflutter pub get
Show outdated dependenciesflutter pub outdated
Upgrade dependencies within their constraintsflutter pub upgrade
Apply automated fixes after the upgradedart fix --apply

Builds and the SDK

TaskCommand
App Bundle for Google Playflutter build appbundle
One APK per architectureflutter build apk --split-per-abi
Archive for the App Storeflutter build ipa
Build with obfuscationflutter build appbundle --obfuscate --split-debug-info=out/android
SDK, engine and tool versionsflutter --version
Switch to the stable channelflutter channel stable
Upgrade Flutterflutter upgrade

Keys in the flutter run terminal

KeyWhat it does
rhot reload: new code, state is preserved
Rhot restart: main() runs again, state is reset
hlist all commands
wprint the widget tree to the console
pshow layout lines
Pshow the performance overlay
qstop the app and quit

Dart

TaskHow to write it
A variable that cannot be reassignedfinal name = 'Ali';
Compile-time constantconst maxItems = 20;
The value can be nullString? nickname;
A default value instead of nullnickname ?? 'guest'
Access it only if it is not nulluser?.name
A named required parametervoid greet({required String name})
A single-expression functionint square(int x) => x * x;
Await the resultfinal user = await loadUser();
A list element by condition['home', if (isAdmin) 'admin']
Several values in one variable(String, int) r = ('Ali', 20);
Pattern-based selectionswitch (code) { 200 => 'ok', _ => 'error' }

Layout widgets

TaskWidget
Children in a column or a rowColumn(children: [title, body]), Row(...)
Take up the remaining space in a Row or ColumnExpanded(child: list)
Padding aroundPadding(padding: EdgeInsets.all(16), child: card)
A gap or a fixed sizeSizedBox(height: 16)
CentreCenter(child: card)
Stack on top of each otherStack(children: [photo, badge])
A long listListView.builder(itemCount: items.length, itemBuilder: buildItem)
Layout across the available widthLayoutBuilder(builder: (context, constraints) => ...)

Section sources

the section is written from these pages

Installation and first run

The recommended installation method is the Flutter extension for VS Code: it downloads the SDK and adds it to PATH. Without VS Code, the SDK is installed from an archive. flutter doctor checks that everything is ready: [✓] marks are only needed for Flutter and the platforms you build for.

Linux

First install the packages the SDK needs. Then there are two routes. Via VS Code: install the Flutter extension (the Dart extension comes with it), choose “Flutter: New Project” in the command palette, then “Download SDK” and “Add SDK to PATH”. Manually: download the archive of the latest stable release from the manual installation page, unpack it into, say, ~/develop, and add the bin directory to PATH.

bashUbuntu and Debian
sudo apt-get update -y && sudo apt-get upgrade -ysudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
bashmanual installation, bash
mkdir -p ~/develop# the archive name is the one you downloadedtar -xf ~/Downloads/flutter_linux_*-stable.tar.xz -C ~/develop/echo 'export PATH="$HOME/develop/flutter/bin:$PATH"' >> ~/.bashrc

In zsh, add the PATH line to ~/.zshenv. Only new sessions pick up the change: close and reopen your terminal and editor.

macOS and Windows

The methods are the same: the Flutter extension in VS Code or the SDK archive for your OS. On macOS, install the Xcode command line tools first (xcode-select --install) — Git is among them; for Macs with Apple Silicon, take the ARM64 archive. On Windows, install Git for Windows and do not put the SDK in a directory that requires administrator rights, such as C:\Program Files\: flutter will report that the SDK is in a protected folder. Building for iOS needs a Mac with Xcode, and for Android you need the Android SDK, most easily from Android Studio; their installation is covered in the “iOS and Swift” and “Android and Kotlin” references, section “Installation and first run”.

Check

Open a new terminal and check that the commands are found and the environment is ready. In the flutter doctor output it is enough to have [✓] marks for Flutter and your target platforms: [!] and [✗] for Android Studio or Xcode can stay as they are while you are not yet building for them.

bashterminal
flutter --versiondart --versionflutter doctor
textexample output
[✓] Flutter (Channel stable, ...)[!] Android toolchain - develop for Android devices    ! Android license status unknown.      Run `flutter doctor --android-licenses` to accept the SDK licenses....

Accept the Android SDK licences with flutter doctor --android-licenses, answering y to each. If flutter is not found, the SDK bin directory did not make it into PATH. flutter doctor -v prints detailed information about every check.

First project

Project names are written in lowercase with underscores (lowercase_with_underscores). flutter create creates the project directory and downloads dependencies, and flutter run asks which device to run the app on when there are several. With the --empty flag, lib/main.dart contains a minimal app.

bashterminal
flutter create my_appcd my_appflutter run
textproject tree
my_app/├── android/       Android project files├── ios/           iOS project files├── lib/│   └── main.dart  entry point: main()├── test/          automated tests├── build/         build output└── pubspec.yaml   name, version and dependencies

The app code lives in lib/, and execution starts at main() in lib/main.dart. pubspec.yaml holds the app metadata and dependencies, like package.json in JavaScript.

Packages from pub.dev

flutter pub add records the package in the pubspec.yaml dependencies and downloads it. If you edit pubspec.yaml by hand, run flutter pub get; the IDE often does this for you. Packages that contain platform code are called plugins. Material and Cupertino are also available as separate packages, material_ui and cupertino_ui; when to switch to them from the built-in libraries is described in the “Widgets” section.

bashin the project directory
flutter pub add shared_preferences

Section sources

the section is written from these pages

Dart syntax

Dart is a statically typed language with type inference in which, by default, no variable can be null. For Flutter, what matters most is final and const, null safety, named parameters and constructors: every widget is built on them.

Variables: var, final, const

var infers the type from the initial value. final can be assigned only once; const is a compile-time constant and is implicitly final. The late modifier is used for a variable whose value is provided after the declaration, and for lazy initialisation: the expression on the right runs on first access.

dartlib/vars.dart
// int inferred from the valuevar count = 0;// can be assigned only oncefinal name = 'Ali';// value known at compile timeconst maxItems = 20;// value assigned later, before the first readlate String token;// readConfig() runs on first accesslate final config = readConfig();

Null safety

A type without ? does not accept null, and the analyzer catches such errors while you are still writing the code. String? allows null, and an uninitialised nullable variable equals null. Operators for such values: ?? supplies a default value, ??= assigns only if the value is currently null, ?. accesses a member only if the object is not null. The ! operator asserts that a value is not null; if you are mistaken, an exception is thrown.

dartlib/nulls.dart
String describe(String? nickname) {  // 'guest' if nickname is null  final shown = nickname ?? 'guest';  // null instead of the call if nickname is null  final length = nickname?.length;  return '$shown ($length)';} int? _cached; int cachedTotal() {  // computed only on the first call  _cached ??= 6 * 7;  return _cached!;}

Functions and parameters

Parameters in curly braces are named: at the call site they are written by name and can appear anywhere in the argument list. A named parameter is optional if it has a default value or its type allows null; otherwise mark it required. Parameters in square brackets are optional positional: they come last, and without a default value their type allows null. A function whose body is a single expression is written with =>. Functions are ordinary values: they are passed as arguments, for example to map or as a tap handler.

dartbin/main.dart
void greet(  String name, {  required String greeting,  int times = 1,}) {  for (var i = 0; i < times; i++) {    print('$greeting, $name!');  }} int square(int x) => x * x; void main() {  greet('Ali', greeting: 'Salom', times: 2);  print([1, 2, 3].map(square).toList());}

Classes and constructors

The this.x parameter in a constructor immediately assigns a value to the field. A named constructor such as Point.origin() provides another way to create an object. A const constructor makes constant objects possible when every field of the class is final. super.x forwards a parameter to the superclass constructor, and with mixes a mixin into the class.

dartlib/point.dart
class Point {  const Point(this.x, this.y);   // another way to create an object  const Point.origin() : x = 0, y = 0;   final double x;  final double y;} class Pixel extends Point {  // x and y are forwarded to the Point constructor  const Pixel(super.x, super.y, {required this.color});   final String color;} const corner = Pixel(0, 0, color: 'red');

Primary constructors

Since Dart 3.13, fields and the primary constructor can be declared right in the class header: a parameter with final or var becomes a field, and a parameter without them is only a parameter. Language version 3.13 or later is required. const before the class name makes the constructor constant.

dartlib/primary.dart
// fields x and y declared in the class headerclass Point(final double x, final double y); // constant primary constructorclass const Tag(final String name); // name without final or var is a parameter, not a fieldclass User(String name) {  final String greeting = 'Hello, $name';}

Collections and switch

In a list (List), set (Set) or map (Map) literal, if, a for loop and the spread operator ... all work. A switch expression returns a value: cases are written with => and a comma, and the default case is _. The compiler checks exhaustiveness: if no case matches a possible value, that is an error. For enum and sealed classes, all cases are known, so _ is unnecessary, and a new subtype immediately shows which switches need a new case.

dartlib/shapes.dart
sealed class Shape {} class Square implements Shape {  Square(this.side);  final double side;} class Circle implements Shape {  Circle(this.radius);  final double radius;} double area(Shape shape) => switch (shape) {  Square(side: var s) => s * s,  Circle(radius: var r) => 3.14159 * r * r,}; List<String> menu(bool isAdmin, List<String> extra) => [  'home',  if (isAdmin) 'admin',  ...extra,]; // for loop inside a literal: squares of the numbersList<int> squares(List<int> numbers) => [for (var n in numbers) n * n];

if-case checks a single value against a pattern and immediately destructures it into variables: if (pair case [int x, int y]) runs the branch only if pair is a list of exactly two integers.

Records: several values at once

A record is an immutable value made up of several fields, for example (String, int) with positional fields or ({String name, int age}) with named ones. A function returns several values as a single record, and a pattern immediately destructures it into variables: positional fields are read through $1 and $2, named ones by name.

dartlib/records.dart
(String, int) userInfo(Map<String, dynamic> json) =>    (json['name'] as String, json['age'] as int); ({String title, int pages}) book() => (title: 'Dart', pages: 320); void main() {  // record fields destructured into variables  final (name, age) = userInfo({'name': 'Dash', 'age': 10});   // the colon spreads named fields into variables  final (:title, :pages) = book();}

Errors: throw, try, on, catch

An exception is thrown with the throw expression, for example throw FormatException('bad input'); any object except null can be thrown, not only Exception and Error. In Dart, exceptions are not declared in signatures and do not have to be caught. on catches exceptions of the given type, catch gives the exception object itself, finally runs in every case, and rethrow passes the exception on.

dartlib/age.dart
int parseAge(String input) {  try {    return int.parse(input);  } on FormatException catch (e) {    print('Not a number: ${e.source}');    return 0;  } finally {    print('parsed: $input');  }}

Shorthand for enum values

When the type is clear from the context, an enum value can be written without the type name: .draft instead of Status.draft. This dot shorthand works in declarations with a type, in function arguments and in switch cases.

dartlib/status.dart
enum Status { draft, published } Status current = .draft; String label(Status s) => switch (s) {  .draft => 'Draft',  .published => 'Published',};

Section sources

the section is written from these pages

Asynchrony in Dart: Future, Stream and isolates

A Future is the result of an operation that will be ready later: a value or an error. async and await wait for it without blocking the UI: while a network or disk request is running, the event loop keeps handling touches and frames. A separate isolate is needed only for long computations that don’t fit between frames.

Future, async and await

An async function returns an incomplete Future right away and runs synchronously up to the first await. The type Future<String> promises a string, whereas Future<void> promises completion without a value. An error thrown from await is caught with a regular try/catch, as in synchronous code.

dartbin/main.dart
import 'dart:io'; Future<String> readConfig() async {  // while the file is being read, the event loop stays free  final text = await File('config.json').readAsString();  return text.trim();} Future<void> main() async {  try {    print(await readConfig());  } on IOException catch (e) {    print('Cannot read config: $e');  }}

Stream: a sequence of events

A Stream delivers values one at a time over time: chunks of a file being read, mouse events, messages. An await for loop receives them until the stream finishes, and a stream error is thrown out of the loop. A function marked async* creates a stream and produces values with yield.

dartbin/countdown.dart
Stream<int> countdown(int from) async* {  for (var i = from; i > 0; i--) {    await Future.delayed(const Duration(seconds: 1));    yield i;  }} Future<void> main() async {  await for (final n in countdown(3)) {    print(n);  }  print('Go');}

Streams come in two kinds. A single-subscription stream — such as reading a file — is listened to once, from beginning to end. A broadcast stream — such as mouse events — can be listened to by several subscribers at once and at any time. listen() returns a StreamSubscription: the subscription can be paused, resumed and cancelled.

The event loop and isolates

All Dart code runs inside isolates. Each isolate has its own memory and a single thread in which the event loop spins: events queue up and are handled one at a time in the order they arrive. On a 60 Hz screen, Flutter adds a “draw a frame” event 60 times a second. If a handler takes longer than the gap between frames, frames fall behind and the UI stutters (jank).

Isolates don’t share memory: data between them is copied in messages.
  1. An event — a frame, a touch, a network reply — joins the event queue of the main isolate.
  2. The event loop takes one event from the queue and runs its handler.
  3. The handler runs to completion or until an await: the loop then moves on to the next events, and the continuation runs once the operation completes.
  4. A long computation is handed off by the main isolate to a background one: the latter has its own memory and its own event loop, and there are no shared variables.
  5. The background isolate returns the result as a message, and an await in the main isolate receives it.

Heavy computations: Isolate.run

Isolate.run() runs a function in a new isolate, returns its result and shuts the isolate down. Messages between isolates are copied; only immutable objects, such as strings, are passed without copying. For a long-lived background isolate that exchanges many messages, use Isolate.spawn() with a SendPort and a ReceivePort. The web has no isolates: if the app is built for the web as well, call compute from Flutter — on mobile and desktop it is the same as Isolate.run, while on the web it runs the function on the main thread.

dartlib/parse.dart
import 'dart:convert';import 'dart:isolate'; Future<List<Object?>> parseBigJson(String text) {  // parsing large JSON must not delay frames  return Isolate.run(    () => jsonDecode(text) as List<Object?>,  );}

In the UI: FutureBuilder and StreamBuilder

FutureBuilder builds a widget from the latest snapshot (AsyncSnapshot) of an operation: waiting, data or an error. Obtain the Future in advance — in initState — and store it in a field of State. If you create it right inside build, the operation will start again on every rebuild of the parent. StreamBuilder works the same way, but for a Stream.

dartlib/profile.dart
import 'package:flutter/material.dart'; Future<String> loadName() async => 'Ali'; class Profile extends StatefulWidget {  const Profile({super.key});   @override  State<Profile> createState() => _ProfileState();} class _ProfileState extends State<Profile> {  late final Future<String> _name;   @override  void initState() {    super.initState();    // the request starts once, not in every build    _name = loadName();  }   @override  Widget build(BuildContext context) {    return FutureBuilder<String>(      future: _name,      builder: (context, snapshot) {        if (snapshot.hasError) {          return Text('${snapshot.error}');        }        if (!snapshot.hasData) {          return const CircularProgressIndicator();        }        return Text(snapshot.data!);      },    );  }}

Section sources

the section is written from these pages

Widgets

A widget is an immutable description of a part of the interface: a piece of text, padding, a button, a whole screen. The interface is assembled from nested widgets. When the state changes, Flutter builds a new description, compares it with the old one and updates on screen only what differs.

Widgets are cheap and are recreated on every rebuild, so two more trees stand behind them. For each widget Flutter creates an element: it stores the widget’s place in the tree and survives rebuilds, and BuildContext is a reference to it. Elements that take part in layout and painting (RenderObjectElement) hold render objects: those compute size and position and paint. If Text('A') is replaced with Text('B'), only the widget is recreated, while the element and the render object are updated in place.

A Container with a colour inserts a ColoredBox widget on build, and Text inserts a RichText; the tree in the DevTools inspector is therefore deeper than in the code.

StatelessWidget and StatefulWidget

StatelessWidget builds the interface only from its fields and the context. StatefulWidget is itself immutable too, and keeps mutable data in a separate State object that lives between build calls. After changing the data, call setState(): Flutter marks the widget as needing a rebuild and calls build again. Without setState() the screen will not update.

dartlib/counter.dart
import 'package:flutter/material.dart'; class Greeting extends StatelessWidget {  const Greeting({super.key, required this.name});   final String name;   @override  Widget build(BuildContext context) => Text('Hello, $name!');} class Counter extends StatefulWidget {  const Counter({super.key});   @override  State<Counter> createState() => _CounterState();} class _CounterState extends State<Counter> {  int _count = 0;   @override  Widget build(BuildContext context) {    return ElevatedButton(      // without setState the screen will not update      onPressed: () => setState(() => _count++),      child: Text('Pressed: $_count'),    );  }}

By convention, a widget’s constructor takes only named parameters: key first, child or children last. Widget fields are always final, and the State class is usually made private: _CounterState.

When build is called

build of a StatelessWidget is called when the widget first enters the tree, when the parent passes a new configuration, and when an InheritedWidget it depends on changes. For a State, setState() is added to that list. Write build so that frequent calls cost nothing:

  • Put const on widgets that do not change, and give your own widgets a const constructor: such a widget is reused, and Flutter skips most of the rebuild.
  • Push state down to the leaves of the tree: a ticking clock is a separate widget, not a setState() for the whole page.
  • Turn a repeating piece of the interface into a widget, not a helper method: Flutter rebuilds just that widget.
  • Do not change the depth or the type of a subtree: instead of “sometimes wrap in IgnorePointer”, always wrap and toggle ignoring.

Base widgets, Material and Cupertino

The widgets library (package:flutter/widgets.dart) is part of the SDK and provides style-neutral building blocks: Row, Column, Stack, GestureDetector, Image, RichText. Design systems run on top of it: Material 3 and the iOS-style Cupertino. Many Material widgets need a MaterialApp higher in the tree: they get the theme from it.

LibraryWhere to import fromRoot and screen frameWhat it is for
widgetsSDK: package:flutter/widgets.dartWidgetsAppyour own design system, packages with no style tie-in
Material 3the material_ui package or the built-in package:flutter/material.dartMaterialApp, ScaffoldAndroid and cross-platform applications
Cupertinothe cupertino_ui package or the built-in package:flutter/cupertino.dartCupertinoApp, CupertinoPageScaffoldapplications primarily for iOS

Since Flutter 3.47, Material and Cupertino ship as separate material_ui and cupertino_ui packages on pub.dev, while the built-in libraries keep working: the examples of this reference import the built-in package:flutter/material.dart. The packages update independently of the SDK. The project’s imports are migrated by dart fix:

bashin the project directory
dart fix --apply --code=migrate_design_widgets

Gestures and buttons

GestureDetector paints nothing itself but catches taps, drags and scaling gestures over its child. The ready-made buttons — ElevatedButton, IconButton, FloatingActionButton — take an onPressed handler, and onPressed: null disables the button.

dartinside build of a State
GestureDetector(  onTap: () => setState(() => _liked = !_liked),  child: Icon(_liked ? Icons.favorite : Icons.favorite_border),)

Keys

Without a key, Flutter matches old and new widgets by type and order. When a list has many widgets of the same type and the order changes, the State may end up with the wrong row. With a key, matching goes by type and key, and the state travels with its own row. A GlobalKey is unique across the whole application: with it, a widget can be moved to another place in the tree together with its state.

dartlib/task_list.dart
ListView.builder(  itemCount: tasks.length,  itemBuilder: (context, i) => TaskTile(    // the row’s state is tied to the task, not to the position    key: ValueKey(tasks[i].id),    task: tasks[i],  ),)

Section sources

the section is written from these pages

Layout and constraints

Layout in Flutter follows one rule: constraints go down, sizes go up, and the parent sets the position. A widget picks its size only within the parent’s constraints, so width: 100 does not always take effect.

Constraints are four numbers: minimum and maximum width and height. The parent passes them to each child, the child picks a size within those limits and reports it back, and the parent decides where to place the child. That is why a widget does not know its position on screen and usually cannot take whatever size it likes.

Layout walks the tree in a single pass: constraints down, sizes up.
  1. The parent — a Column with padding of 5 — receives a width of 0–300 and a height of 0–85 from its own parent.
  2. It subtracts the padding and passes constraints of 0–290 by 0–75 to the first child.
  3. The first child picks a size within those limits — 290 by 20 — and reports it to the parent.
  4. The second child is left 55 of height: it receives 0–290 by 0–55 and picks 140 by 30.
  5. The parent places the first child at (5, 5) and the second at (80, 25).
  6. Having placed the children, the parent reports its own size upward — 300 by 60.

Tight constraints allow exactly one size: the minimum equals the maximum. This is how the screen fixes the size of the root widget. Loose constraints start at zero: Center turns the screen’s tight constraints into loose ones, so a child inside can be smaller than the screen. Unbounded constraints have an infinite maximum: most often this is the main axis inside Row and Column, and scrollable areas.

Row and Column

Row lays out its children horizontally, Column vertically; a child can itself be another Row or Column. Along the main axis the children are aligned by mainAxisAlignment, across it by crossAxisAlignment. By default Row and Column take up all the space along the main axis, while mainAxisSize: MainAxisSize.min packs the children together.

dartlib/product_card.dart
Column(  mainAxisAlignment: MainAxisAlignment.spaceEvenly,  crossAxisAlignment: CrossAxisAlignment.start,  children: [    Text(product.title),    Row(      mainAxisSize: MainAxisSize.min,      children: [        const Icon(Icons.star),        Text('${product.rating}'),      ],    ),  ],)

Expanded and Flexible

To make a child of a Row or Column fill the remaining space, wrap it in Expanded. Several Expanded widgets share the space in proportion to flex, 1 by default. Flexible also allots the child a share of the space but lets it take less than that share, while Expanded forces it to fill the share in full. Both ignore the width the child would choose on its own.

dartlib/gallery.dart
Row(  children: [    Expanded(child: Image.asset('images/pic1.jpg')),    // the middle image is twice as wide as its neighbours    Expanded(flex: 2, child: Image.asset('images/pic2.jpg')),    Expanded(child: Image.asset('images/pic3.jpg')),  ],)

Padding, sizing and stacking

WidgetWhat it does
Containerpadding, margins, border, background; without sizes it tries to take up all the space, with width and height it holds the given size
Paddingpadding around a single child
SizedBoxa fixed size for a child or an empty gap between children
Center, Alignplace the child in the centre or at a given point; the child may be smaller
Stackstacks children: the first is the base, the rest go on top; the content does not scroll
Carda Material card with rounded corners and a shadow; the size is set via SizedBox

Scrolling and long lists

SingleChildScrollView scrolls a single child, ListView and GridView a list and a grid. The plain ListView constructor builds every item at once and suits short lists. For long and infinite lists use ListView.builder: it builds items only when they come on screen. If the rows are all the same height, set prototypeItem or itemExtent, and the scroller will not have to measure every row.

dartlib/items_list.dart
ListView.builder(  itemCount: items.length,  // all rows the same height: easier scrolling  prototypeItem: ListTile(title: Text(items.first)),  itemBuilder: (context, index) {    return ListTile(title: Text(items[index]));  },)

For complex effects such as a collapsing header or parallax, slivers are assembled into a CustomScrollView.

Adaptive layout: MediaQuery and LayoutBuilder

Choose the layout by the available space, not by device type. MediaQuery.sizeOf(context) gives the size of the whole application window and rebuilds the widget when it changes. LayoutBuilder gives the constraints from the parent — the space at exactly this point of the tree. Material guidance: a bottom NavigationBar for windows narrower than 600 logical pixels, a side NavigationRail for windows of 600 and more.

dartlib/catalog.dart
LayoutBuilder(  builder: (context, constraints) {    // the width of the space the parent has allotted    if (constraints.maxWidth < 600) {      return const ProductList();    }    return const ProductGrid();  },)

Walkthrough: the card row overflows

A product card is a Row of an image and a Column with a title and a description. The Row does not constrain the width of its children, so a Text with a long description takes the width of its text, and the Column becomes wider than the screen. Flutter draws yellow and black stripes along the edge where the space ran out.

dartthis is how the row overflows
Row(  children: [    Image.asset('images/phone.jpg', width: 80),    Column(      crossAxisAlignment: CrossAxisAlignment.start,      children: [        Text(product.title),        Text(product.description),      ],    ),  ],)

Wrap the Column in Expanded: it will receive exactly the remaining width, and the long text will wrap.

dartlib/product_card.dart
Row(  children: [    Image.asset('images/phone.jpg', width: 80),    const SizedBox(width: 12),    // the Column gets only the remaining width    Expanded(      child: Column(        crossAxisAlignment: CrossAxisAlignment.start,        children: [          Text(product.title),          Text(product.description),        ],      ),    ),  ],)

Section sources

the section is written from these pages

State and architecture

State is the data from which the interface can be rebuilt at any moment. Local state of a single widget — the selected tab, a PageView page — lives in State and changes through setState(). State shared by many screens — the shopping cart, the signed-in user — is lifted higher up the tree and passed down to descendants.

Flutter is declarative: the interface is built from the current state. You do not change a widget on screen with a call such as widget.setText; you change the state, and Flutter rebuilds the interface through build. So for any piece of screen state there is a single path in the code.

Local and shared state

SignLocal (ephemeral)Shared (app state)
Examplesthe current PageView page, the selected tab, animation progresssettings, sign-in data, the cart, articles read
Who reads itone widgetmany parts of the app
Keep between runsnot neededoften needed
How to manageStatefulWidget and setState()a model higher in the tree: ChangeNotifier and provider

The boundary is not strict: a tab becomes shared state if it needs to be changed from outside or kept between sessions. As an app grows, state is moved from one kind to the other.

The State life cycle

The State object is created when a StatefulWidget enters the tree and lives as long as the widget stays in place. Create resources — subscriptions, timers, controllers — in initState() and release them in dispose().

  1. createState() — the framework creates the State and binds it to a BuildContext for good; from that moment mounted is true.
  2. initState() — one-time initialisation: subscriptions, timers, starting requests.
  3. didChangeDependencies() — right after initState() and again when the InheritedWidget the State depends on changes.
  4. build() — may run any number of times, for example after setState().
  5. didUpdateWidget(oldWidget) — the parent rebuilt a widget of the same type with the same key; the widget field already points to the new widget, and build() always follows.
  6. deactivate() — the subtree was removed from the tree; until the end of the frame it may be inserted elsewhere, and then build() runs again.
  7. dispose() — the State will not be built again, mounted is false, and calling setState() is an error.
dartlib/clock.dart
import 'dart:async'; import 'package:flutter/material.dart'; class Clock extends StatefulWidget {  const Clock({super.key});   @override  State<Clock> createState() => _ClockState();} class _ClockState extends State<Clock> {  late final Timer _timer;  DateTime _now = DateTime.now();   @override  void initState() {    super.initState();    _timer = Timer.periodic(const Duration(seconds: 1), (_) {      setState(() => _now = DateTime.now());    });  }   @override  void dispose() {    // otherwise the timer would call setState after dispose    _timer.cancel();    super.dispose();  }   @override  Widget build(BuildContext context) => Text('$_now');}

Shared state: ChangeNotifier and provider

State that several widgets need should live above everyone who reads it. Threading callbacks through many levels is awkward, so Flutter has widgets that hand data down to every descendant: InheritedWidget, InheritedNotifier, InheritedModel. For beginners the official documentation suggests starting with the provider package, built on top of them, and the ChangeNotifier class from the SDK.

bashin the project directory
flutter pub add provider
dartlib/cart_model.dart
import 'package:flutter/foundation.dart'; class CartModel extends ChangeNotifier {  final List<String> _items = [];   List<String> get items => List.unmodifiable(_items);   void add(String item) {    _items.add(item);    // rebuilds the widgets listening to the model    notifyListeners();  }}
dartlib/main.dart
import 'package:flutter/material.dart';import 'package:provider/provider.dart'; import 'cart_model.dart'; void main() {  runApp(    ChangeNotifierProvider(      create: (context) => CartModel(),      child: const MyApp(),    ),  );} class CartBadge extends StatelessWidget {  const CartBadge({super.key});   @override  Widget build(BuildContext context) {    // only this Text rebuilds when notifyListeners fires    return Consumer<CartModel>(      builder: (context, cart, child) {        return Text('Items: ${cart.items.length}');      },    );  }}

Place Consumer as deep as possible: when notifyListeners() fires, only its builder rebuilds. If you do not need the model data for display, only a method call, write Provider.of<CartModel>(context, listen: false).add('book') — the widget will not rebuild. ChangeNotifierProvider calls dispose() on the model itself when it is no longer needed.

Recommended architecture: MVVM

The official guide splits the app into a UI layer and a data layer and describes its components following the MVVM pattern (Model-View-ViewModel):

ComponentLayerWhat it does
ViewUIscreen widgets; no business logic, everything comes from the view model
View modelUIturns data into screen state and gives commands for buttons; one per view
Repositorydatathe single source of truth about the data: cache, retries, error handling
Servicedataa wrapper over REST, files or platform APIs, with no state of its own

A view model can be tested without widgets, and one repository can serve several view models. A separate use-case layer is added only when logic repeats or spans several repositories.

Common mistakes

  • setState() after dispose(): a network response arrives when the screen is already gone. After an await in State, check if (!mounted) return;.
  • Subscriptions and timers not cancelled in dispose(): they keep running after the user leaves the screen.
  • A State field changed without setState(): the data changed, the screen did not.
  • Trying to change a widget from outside by calling its method: instead of cart.updateWith(item), change the model and the widget rebuilds with the new data.

Section sources

the section is written from these pages

Data: network, JSON and storage

The http package performs HTTP requests, the built-in dart:convert library parses JSON, and on the device data is stored in shared_preferences (a few values under keys) or in SQLite via sqflite. The http package works on Android, iOS, macOS, Windows, Linux and the web.

Making a network request

Add the package and the network permissions. An Android app needs the INTERNET permission in AndroidManifest.xml, and a macOS app needs the com.apple.security.network.client entitlement in the DebugProfile.entitlements and Release.entitlements files.

bashin the project directory
flutter pub add http
xmlAndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
xmlmacos/Runner/*.entitlements
<key>com.apple.security.network.client</key><true/>

Check the response code: for any code other than 200, throw an exception instead of returning null. FutureBuilder will then show the error through snapshot.hasError. Start the request itself in initState(), not in build(): build is called often, and the request would be repeated.

dartlib/api.dart
import 'dart:convert'; import 'package:http/http.dart' as http; Future<Album> fetchAlbum(int id) async {  final response = await http.get(    Uri.parse('https://example.com/api/albums/$id'),    headers: {'Accept': 'application/json'},  );  if (response.statusCode != 200) {    throw Exception('HTTP ${response.statusCode}');  }  final body = jsonDecode(response.body) as Map<String, dynamic>;  return Album.fromJson(body);}

JSON to model classes

jsonDecode() returns dynamic, and a typo in a field name only surfaces at runtime. So parse JSON into a model class with a fromJson constructor and a toJson method; jsonEncode() calls toJson() for you. Pattern matching in a switch checks the structure and the types in a single step.

dartlib/album.dart
class Album {  const Album({required this.id, required this.title});   final int id;  final String title;   factory Album.fromJson(Map<String, dynamic> json) {    return switch (json) {      {'id': int id, 'title': String title} =>        Album(id: id, title: title),      _ => throw const FormatException('Bad album JSON'),    };  }   Map<String, dynamic> toJson() => {'id': id, 'title': title};}

When there are many models, the parsing code is generated: json_serializable and build_runner produce it from the annotations in *.g.dart files, and the compiler catches typos. Flutter has no runtime reflection like GSON or Jackson: it would get in the way of removing unused code (tree shaking) from the release build.

bashin the project directory
flutter pub add json_annotation dev:build_runner dev:json_serializabledart run build_runner build --delete-conflicting-outputs

Settings: shared_preferences

shared_preferences is a good fit for a small set of key–value pairs. It stores only int, double, bool, String and List<String>, is not designed for large volumes and does not guarantee that the data will survive an app restart, so keep anything important in a database. A getter throws an exception if the stored value is of a different type.

dartin an async function
final prefs = await SharedPreferences.getInstance();await prefs.setBool('darkMode', true);// null if the key is missing: fall back to the default valuefinal darkMode = prefs.getBool('darkMode') ?? false;await prefs.remove('darkMode');

Database: SQLite

For large volumes and queries, add sqflite and path. Build the database file path with join and getDatabasesPath(), create the tables in onCreate, and version opens the way to schema updates in future versions of the app.

bashin the project directory
flutter pub add sqflite path
dartlib/notes_db.dart
import 'package:flutter/widgets.dart';import 'package:path/path.dart';import 'package:sqflite/sqflite.dart'; Future<Database> openNotes() async {  WidgetsFlutterBinding.ensureInitialized();  return openDatabase(    join(await getDatabasesPath(), 'notes.db'),    onCreate: (db, version) => db.execute(      'CREATE TABLE notes(id INTEGER PRIMARY KEY, text TEXT)',    ),    version: 1,  );} Future<void> saveNote(Database db, int id, String text) {  return db.insert(    'notes',    {'id': id, 'text': text},    // the same record with the same id replaces the old one    conflictAlgorithm: ConflictAlgorithm.replace,  );}

Keep the networking code and storage out of the widgets, in separate classes; how to split the app into layers is described in the “State and architecture” section.

Section sources

the section is written from these pages

Building and publishing

A release build is optimised machine code with no debugging and no assert checks. For Google Play, flutter build appbundle builds it; for the App Store, flutter build ipa. Before your first release, set up signing, the application ID and the version number.

Build modes: debug, profile, release

ModeWhat it is forCommandNotes
debugdevelopment and hot reloadflutter runassert is enabled, the debugger and DevTools attach
profileperformance measurementsflutter run --profilelike release, but with tracing and DevTools; does not work in the emulator or simulator
releasepublishingflutter run --release, flutter buildmaximum optimisation, debugging is disabled; does not work in the emulator or simulator

The version number

The version is set by the version line in pubspec.yaml: three numbers separated by dots are the version name, and the number after + is the build number. On Android they become versionName and versionCode, on iOS CFBundleShortVersionString and CFBundleVersion. Every upload to App Store Connect requires a new build number. The --build-name and --build-number flags override them at build time.

yamlpubspec.yaml
version: 1.2.0+7
bashin the project directory
flutter build appbundle --build-name=1.2.0 --build-number=8

Android: signing and the App Bundle

Android has two keys. With the upload key you sign the file you upload to Google Play, while the app signing key is what Play uses to sign the app that users download; it is created through Play App Signing. Create the upload key keystore:

bashmacOS and Linux
keytool -genkey -v -keystore ~/upload-keystore.jks \  -keyalg RSA -keysize 2048 -validity 10000 \  -alias upload -storetype JKS

Put the passwords and the keystore path into android/key.properties, and android/app/build.gradle.kts should read this file and wire in the release signing configuration. Without it, the template signs the release build with the debug key — only so that flutter run --release works.

propertiesandroid/key.properties
storePassword=change-mekeyPassword=change-mekeyAlias=uploadstoreFile=/home/ali/upload-keystore.jks
kotlinandroid/app/build.gradle.kts
import java.io.FileInputStreamimport java.util.Properties val keystoreProperties = Properties()val keystorePropertiesFile = rootProject.file("key.properties")if (keystorePropertiesFile.exists()) {    keystoreProperties.load(FileInputStream(keystorePropertiesFile))} android {    // ...    signingConfigs {        create("release") {            val props = keystoreProperties            keyAlias = props.getProperty("keyAlias")            keyPassword = props.getProperty("keyPassword")            storeFile = props.getProperty("storeFile")?.let { file(it) }            storePassword = props.getProperty("storePassword")        }    }    buildTypes {        release {            signingConfig = signingConfigs.getByName("release")        }    }}

The App Bundle is the preferred format for Google Play; the file will appear in build/app/outputs/bundle/release/app.aab. For stores without App Bundle support, build an APK with --split-per-abi: you get a separate file for armeabi-v7a, arm64-v8a and x86-64 instead of a single fat APK for all architectures.

bashin the project directory
flutter build appbundleflutter build apk --split-per-abi

R8 shrinks the release build by default; the --no-shrink flag turns it off. Check AndroidManifest.xml: android:label is the app name, and if your app needs the network, add the INTERNET permission. The template does not include it: during development, the network is available only for talking to the Flutter tooling. For Google Play requirements, see the “Android and Kotlin” reference, the section on publishing.

iOS: the archive and App Store Connect

For iOS you need a Mac with Xcode and membership in the Apple Developer Program. Register the Bundle ID, create the app record in App Store Connect, and in Xcode (open ios/Runner.xcworkspace) check the Display Name, Bundle Identifier, Team and signing settings. Then build the archive: flutter build ipa creates an Xcode archive in build/ios/archive/ and an .ipa bundle for the App Store in build/ios/ipa/.

bashon a Mac, in the project directory
flutter build ipaxcrun altool --upload-app --type ios \  -f build/ios/ipa/*.ipa \  --apiKey "$ASC_KEY_ID" \  --apiIssuer "$ASC_ISSUER_ID"

You can also upload the build through Xcode: open the archive, click “Validate App”, then “Distribute App”. Once the build passes validation, you can distribute it to testers through TestFlight or send it for App Store review. For App Store requirements, see the “iOS and Swift” reference, the section on publishing.

Obfuscation and symbol files

--obfuscate replaces class and function names in the compiled Dart code. It works only in release and is not supported on the web: a release web build is minified anyway. Together with it, --split-debug-info is required — the directory for the symbol files. Keep them for every version you release: without them, the stack trace from a crash report cannot be decoded.

bashin the project directory
flutter build appbundle \  --obfuscate \  --split-debug-info=out/androidflutter symbolize \  -i crash.txt \  -d out/android/app.android-arm64.symbols

Code that compares type names, such as runtimeType.toString(), breaks after obfuscation. Enum value names are not obfuscated yet.

Build flavours

A flavour is a variant of the app with its own application ID, name, icon or API key, such as staging and production. On Android these are product flavours in build.gradle.kts; you run and build a flavour with the --flavor flag.

bashin the project directory
flutter run --flavor stagingflutter build apk --flavor staging

Section sources

the section is written from these pages

Common errors and diagnostics

Start with the first error in the flutter run console: the errors that follow are often its consequences. For layout errors Flutter names the widget and the line of code where it was created. See the widget tree and sizes in the DevTools inspector, and flutter doctor -v reports environment problems.

  1. flutter doctor -v — the SDK, Android toolchain, Xcode, connected devices.
  2. The flutter run console — the first error and the widget that caused it.
  3. DevTools, the widget inspector — the tree, properties and layout.
  4. DevTools, the Performance tab — janky frames; measure in profile mode.

A RenderFlex overflowed

Cause: a Row or Column has a child without a size limit along the main axis. For example, a Column with a long Text inside a Row tries to become wider than the Row can allow. Yellow and black stripes appear at the edge, and the console shows a message naming the widget and the line of code.

textexample output
A RenderFlex overflowed by 1146 pixels on the right. The relevant error-causing widget was    Row      lib/errors/renderflex_overflow_column.dart:23...
dartfix
Row(  children: [    const Icon(Icons.message),    // the Column gets only the remaining width    Expanded(child: Column(children: lines)),  ],)

Vertical viewport was given unbounded height

Cause: a ListView or GridView inside a Column. The list takes up all the available height, while a Column does not constrain the height of its children. Fix: wrap the list in an Expanded so that it takes the remaining height, or set the height with a SizedBox.

dartfix
Column(  children: [    const Text('Header'),    Expanded(child: ListView(children: tiles)),  ],)

An InputDecorator...cannot have an unbounded width

Cause: a TextField or TextFormField inside a Row, without a width limit. Fix: wrap the field in an Expanded or set the width with a SizedBox.

dartfix
Row(children: [Expanded(child: TextFormField())])

RenderBox was not laid out

Cause: usually a consequence of an earlier constraints error — most often Vertical viewport was given unbounded height or an InputDecorator error with unbounded width. Scroll up in the console and fix the first error.

Incorrect use of ParentDataWidget

Cause: a widget that needs a particular parent is not placed directly inside it:

WidgetExpected parent
Expanded, FlexibleRow, Column or Flex
PositionedStack
TableCellTable

Fix: move the widget so that its immediate parent is the one it needs, with no intermediate Padding or Container.

setState() or markNeedsBuild() called during build

Cause: setState() is called directly or indirectly from build. A common case is showDialog in build: the dialog itself triggers a rebuild, and build may run on every frame. Fix: show the dialog from an event handler, such as a button press, or open it as a route through the Navigator.

dartfix
ElevatedButton(  onPressed: () {    showDialog<void>(      context: context,      builder: (context) => const AlertDialog(title: Text('Saved')),    );  },  child: const Text('Save'),)

The ScrollController is attached to multiple scroll views

Cause: one ScrollController is attached to several scrollable widgets at once. This is more common on the web and on the desktop, where several lists are on screen at the same time. Fix: create a separate controller for each list.

A red or grey screen instead of the interface

Cause: an unhandled exception or a rendering error, such as an overflow. A widget that fails to build is replaced by an ErrorWidget: in debug and profile it is a red screen with the error text, while in release it is a grey background. Errors from the build, layout and paint phases go to FlutterError.onError; errors outside Flutter’s callbacks, for example in asynchronous code, go to PlatformDispatcher.instance.onError. Set both handlers and send errors to your reporting service.

dartlib/main.dart
import 'dart:ui'; import 'package:flutter/material.dart'; void main() {  // errors from the build, layout and paint phases  FlutterError.onError = (details) {    FlutterError.presentError(details);    reportError(details.exception, details.stack);  };  // errors outside Flutter’s callbacks, for example in async code  PlatformDispatcher.instance.onError = (error, stack) {    reportError(error, stack);    return true;  };  runApp(const MyApp());}

Logs and breakpoints in code

debugPrint() does not drop lines when there is a lot of output, but it prints in release mode as well unless you wrap it in a mode check. log() from dart:developer writes messages with a category, and the Logging tab in DevTools shows them. debugger() stops execution in the debugger, and with a when argument — only when the condition holds.

dartlib/cart.dart
import 'dart:developer' as developer; void onPriceLoaded(double price) {  developer.log('price: $price', name: 'shop.cart');  // stop in the debugger only on a strange price  developer.debugger(when: price < 0);}

Environment and installation

SymptomCauseWhat to do
flutter is not foundthe SDK’s bin directory is not in PATHadd it to PATH and open a new terminal
Android license status unknownthe Android SDK licences have not been acceptedflutter doctor --android-licenses, answer y
cmdline-tools component is missingAndroid SDK Command-line Tools are missinginstall them in Android Studio: Tools → SDK Manager
The SDK is in a protected folderWindows: the SDK is in a directory that requires administrator rightsmove the SDK, for example to C:\src\flutter
exit code: 69 during flutter pub getno connection to pub.devcheck the network, then flutter doctor -v

Section sources

the section is written from these pages

Versions and what’s new

The reference covers Flutter 3.47 with Dart 3.13. The latest release is Flutter 3.47.9 of 29 October 2026, and it ships Dart 3.13.7. A new stable branch comes out roughly once a quarter, and only the latest one receives fixes.

Release channels: stable — for new users and production; beta — the next branch, usually updated on the first Wednesday of the month; main — the newest changes without full testing. Roughly every third beta becomes stable. Flutter version numbers follow a revised calendar versioning scheme (CalVer), and the branch schedule for the year is published on the SDK archive page.

BranchStatusLatest releaseDart
3.47current stable, receives fixes3.47.9, 29 October 20263.13.7
3.44no more fixes3.44.9, 6 August 20263.12.2
3.41no more fixes3.41.9, 30 April 20263.11.5

What’s new in Flutter 3.47 and Dart 3.13

  • Widgets: Material and Cupertino are now available as separate packages, material_ui and cupertino_ui 1.0. Migrating is optional; the built-in libraries remain in the SDK for now.
  • What Flutter is and how it works: Impeller is now the default rendering engine on macOS, Windows and Linux.
  • Widgets: Widget Previews is now stable.
  • Builds and publishing: the minimum versions are iOS 15 and macOS 12; Android needs Java 17, flutter.minSdkVersion defaults to API 24 and flutter.targetSdkVersion to API 36; flavors are now available on Windows and Linux as well.
  • Builds and publishing: the iOS 27 SDK requires the UIScene lifecycle. Most flutter apps are switched to it automatically during the build; do it manually if AppDelegate has your own native code or if plugins still rely on the old lifecycle.
  • Dart syntax: primary constructors — the fields and the constructor in the class header; final and var on ordinary parameters are now an error.
  • Dart syntax: the type promotion rules have been fixed — this is a breaking change.
  • Dart async: Future.pause is a replacement for Future.delayed without a callback.

Deprecated and removed

  • describeEnum was removed in 3.47: use the name getter on the enum value instead.
  • The built-in package:flutter/material.dart and package:flutter/cupertino.dart will be deprecated in one of the upcoming stable releases. To migrate imports to the packages, run dart fix --apply --code=migrate_design_widgets.
  • Intel Macs: building on one prints warnings that will become errors in a future release. To build the app for ARM64 only, run flutter config --enable-macos-arm64-only.
  • Dart 3.13: the analyzer options strict-raw-types and strict-casts have been replaced by the linter rules no_raw_types and no_dynamic_casts.
  • Dart 3.13: the runtime no longer ships fallback root certificates for the case when the system has none; pass them via --root-certs-file or --root-certs-cache.

Security updates

IdentifierWhat is affectedFixed in
GHSA-frr6-h895-5pxpTLS in dart:io on Android, Windows and Linux: BoringSSL did not block the compromised eMudhra intermediate certificatesFlutter 3.47.8, Dart 3.13.7
flutter/190987the libpng library in the engineFlutter 3.47.2
flutter/189156GeneratedPluginRegistrant: validation of plugin identifiers against code injectionFlutter 3.47.1

The GHSA-frr6-h895-5pxp fix only reaches the app at build time: update the SDK, then rebuild and republish your apps for Android, Windows and Linux.

How to upgrade

  1. Review the breaking changes of the new branch.
  2. Switch to the stable channel and update the SDK.
  3. See what dart fix suggests and apply the automated migrations.
  4. Build the app for all platforms and run the tests.
bashin the project directory
flutter channel stableflutter upgradedart fix --dry-rundart fix --apply

Section sources

the section is written from these pages

End of the reference

What changed

revision history · 3 entries

Every edit is saved as a revision: a snapshot of the reference, the reason and a summary of changes. The published version changes only after the same checks as at creation.

  1. Manual edit

    reason: manual edit
  2. Manual edit

    reason: manual edit
  3. Reference updated

Weekly check

How the reference is checked

Once a week — and right after news of a release or a vulnerability — the reference is checked in three steps.

  1. 1. Freshness

    Sections are compared with the release notes and changelogs from the official sources and with the topic’s news.

  2. 2. Errors

    Every section is read again: wrong facts, outdated APIs and flags, broken examples.

  3. 3. Links — by an HTTP request

    Every source link must respond. A broken link is a reason to recheck the section.

No findings — only the date changes. Findings — only the affected sections are rewritten, and they appear in “What changed”. A new version replaces the published one only after passing the same checks as at creation.

Statuses

Verified
no findings
Updated
sections rewritten, edits are listed
Rechecking
while the check runs, the previous version stays open
Needs review
disputed points: the verified version is shown, editors review

Last check

9 Nov · Check · updated · no findings

Found an error in the reference?

On the topic

tracks, news and other references
The whole “Flutter” topic
All references · 61