Cross platform common paths #48556
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-io
P2
A bug or feature request we're likely to work on
triaged
Issue has been triaged by sub team
type-enhancement
A request for a change that isn't a bug
When working on desktop platforms it is a quite common need to get path's to certain standards that vary platform to platform, for example:
HOME
orUSERPROFILE
environment variables depending on the platform.~/.<my app>
or~/.config/<my app>
on Linux~/.<my app>
on macOS%APPDATA%/<my app>
on windows%TEMP%
on windows?,.cache/<my app>
, ...)Right now dart provides a cross-platform solution for one of those, systemTemp but none of the others.
While the core libraries do not provide such functionality (which, being truthful, probably no language's standard library provides) there is a risk of every app finding it's own solution which may be better, worse, secure, insecure or full of bugs and unexpected corner-cases.
Knowing where an app is supposed to keeps its caches & configurations or where the user home folder lives is not only platform specific but may also vary depending on the distribution method (App Store & Microsoft Store do have specific recommendations / requirements about that).
Also, it would be risky to expect every developer to know all the appropiate paths on all platforms and stores.
Flutter team has started to walk on this direction with the xdg_directories package, though that's not cross-platform.
So, bottom line, feature request: provide a cross-platform way to retrieve
Directory
instances of common / standard folders. Either in core or as an official package.References,
My current dart version is :
Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "windows_x64"
.The text was updated successfully, but these errors were encountered: