In
2023, the flutter tool introduced a new version metadata (JSON) format,
$FLUTTER_ROOT/bin/cache/flutter.version.json, which replaces the older (flat-file)
$FLUTTER_ROOT/version file as a strict upgrade with the ability to add more information over time.
When will the 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 after 3.25, we will stop (by default) generating
$FLUTTER_ROOT/version and (only) generate
$FLUTTER_ROOT/bin/cache/flutter.version.json and in a release after that, the flag will no longer be available.
How to prepare for this change?In short, most users will have to do nothing. Users with custom tools that previously read the
$FLUTTER_ROOT/version file will instead need to parse
$FLUTTER_ROOT/bin/cache/flutter.version.json, and the read the (string) value of the key
"flutterVersion". An example of this within our own repository is
#172601.
In an upcoming master channel release, the
$FLUTTER_ROOT/version file will no longer be emitted. It is possible to opt-out and continue the file being emitted (temporarily) by using the flag
flutter config --no-enable-omit-legacy-version-file.