Tool breaking change: deprecating synthetic `package:flutter_gen`

489 views
Skip to first unread message

Matan Lurey

unread,
Nov 5, 2024, 3:00:26 PM11/5/24
to flutter-...@googlegroups.com
flutter_gen is a virtual (synthetic) package that is created by the flutter command-line tool to allow developers to import that package to access generated symbols and functionality, such as for internationalization.

As the package is not listed in an app's pubspec.yaml, and is created via re-writing the (generated) package_config.json, numerous problems have been created that are not easily addressed: #73970, #102983.

We will deprecate and push users into checking the generated files into their application instead.

When will this change happen?
We estimate that in N+1 stable releases (not the one yet to be released, but the following), i.e. the first stable release of 2025, we will stop (by default) generating a synthetic `package:flutter_gen` and instead write to the existing configurable output location.

How to prepare for this change?

Users that do not have the following stanza in their pubspec.yaml will do nothing:
flutter:
  generate: true

It is already possible to opt-out of the synthetic package:flutter_gen by specifying the following in a file called l10n.yaml (next to your pubspec.yaml file) and specifying synthetic-package: false.
Reply all
Reply to author
Forward
0 new messages