The `package:flutter_lints` defines the latest set of recommended lints that encourage good coding practices for Flutter apps, packages, and plugins. Projects created with `flutter create` using Flutter version 2.5 or newer are already enabled to use the latest set of recommended lints. Projects created prior to that version can upgrade to it with the instructions in this guide.
Original behavior
Prior to the introduction of `package:flutter_lints`, the Flutter framework shipped with a set of lints defined in `analysis_options_user.yaml` that was used by the dart analyzer to identify code issues if a Flutter project didn't define a custom `analysis_options.yaml` file. Since `analysis_options_user.yaml` was tied to a particular framework version, it was difficult to evolve without breaking existing apps, packages, and plugins. As a result of that, the lints defined in `analysis_options_user.yaml` are heavily outdated. To fix this, `package:flutter_lints` was created. The package version
New behavior
Not stated in the source.
- Who is affected
- Applications and packages relying on the previous behaviour or signature.
- Practical impact
- Behaviour or API differences that can break builds or change runtime behaviour.
- What action should I take?
- Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
Follow these steps to migrate your Flutter project to use the latest recommended
lints from package:flutter_lints:
Add a dev_dependency on package:flutter_lints to your project's pubspec.yaml
by running flutter pub add --dev flutter_lints in the root directory of the
project.
Create an analysis_options.yaml file in the root directory of your project
(next to the pubspec.yaml file) with the following content:
include: package:flutter_lints/flutter.yamlThe newly activated lint set may identify some new issues in your code. To find
them, open your project in an [IDE with Dart support][] or run flutter analyze
on the command line. You may be able to fix some of the reported issues
automatically by running dart fix --apply in the root directory of your
project.
Existing custom analysis_options.yaml file
If your project already has a custom analysis_options.yaml file at its root,
add include: package:flutter_lints/flutter.yaml to it at the top to activate
the lints from package:flutter_lints. If your analysis_options.yaml already
contains an include: directive you have to decide whether you want to keep
those lints or whether you want to replace it with the lints from
package:flutter_lints because the Dart analyzer only supports one include:
directive per analysis_options.yaml file.
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.Listed in the official breaking-changes index (docs.flutter.dev/release/breaking-changes).
An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.
- Official migration guide
- package:flutter_lints
- Package dependencies
- Customizing static analysis
- Issue 78432 - Update lint set for Flutter applications
- Add flutter_lints package
- Integrate package:flutter_lints into templates
- Source commit
- b3045439b7c0
- Source last updated
- Oct 21, 2026
- Last synchronized
- Oct 21, 2026
- Publication status
- published
Publication history
- Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.