2af3166 landed support for storing data created by Dart and Flutter tooling in a central location that satisfies OS-specifications.
The directory location depends on the current OS:
- on Windows:
%LOCALAPPDATA%\Dart\<tool>
- on Mac OS:
$HOME/Library/Application Support/Dart/<tool>
- on Linux:
$XDG_STATE_HOME/Dart/<tool> if $XDG_STATE_HOME is defined, and
$HOME/.local/state/Dart/<tool> otherwise.
The Dart data home can be overridden with the DART_DATA_HOME environment variable.
This has been adopted in a handful of places, but various parts of the Dart and Flutter tooling have not been migrated yet:
We are open for receiving PRs to migrate these existing places. Please also provide a migration strategy. (E.g. Do we keep the old dir as fallback? Do we write code to move the directory? What happens on upgrades/downgrades of the Dart and Flutter SDK.)
We are not interested in endless discussions. So please keep your comments here to questions on how to implement this. (If you're interested in the discussions you can read the very long discussion threads in their full length. #60922 #41560)
Update: package:dart_data_home has been published, so flutter_tool can be updated as well.
2af3166 landed support for storing data created by Dart and Flutter tooling in a central location that satisfies OS-specifications.
The directory location depends on the current OS:
%LOCALAPPDATA%\Dart\<tool>$HOME/Library/Application Support/Dart/<tool>$XDG_STATE_HOME/Dart/<tool>if$XDG_STATE_HOMEis defined, and$HOME/.local/state/Dart/<tool>otherwise.The Dart data home can be overridden with the
DART_DATA_HOMEenvironment variable.This has been adopted in a handful of places, but various parts of the Dart and Flutter tooling have not been migrated yet:
We are open for receiving PRs to migrate these existing places. Please also provide a migration strategy. (E.g. Do we keep the old dir as fallback? Do we write code to move the directory? What happens on upgrades/downgrades of the Dart and Flutter SDK.)
We are not interested in endless discussions. So please keep your comments here to questions on how to implement this. (If you're interested in the discussions you can read the very long discussion threads in their full length. #60922 #41560)
Update:
package:dart_data_homehas been published, soflutter_toolcan be updated as well.