A Flutter plugin for finding commonly used locations on the filesystem. Supports Android, iOS, Linux, macOS and Windows. Not all methods are supported on all platforms.
Android | iOS | Linux | macOS | Windows | |
---|---|---|---|---|---|
Support | SDK 16+ | 9.0+ | Any | 10.11+ | Windows 10+ |
To use this plugin, add path_provider
as a dependency in your pubspec.yaml file.
Directory tempDir = await getTemporaryDirectory(); String tempPath = tempDir.path; Directory appDocDir = await getApplicationDocumentsDirectory(); String appDocPath = appDocDir.path;
Directories support by platform:
Directory | Android | iOS | Linux | macOS | Windows |
---|---|---|---|---|---|
Temporary | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Application Support | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Application Library | ❌️ | ✔️ | ❌️ | ✔️ | ❌️ |
Application Documents | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
External Storage | ✔️ | ❌ | ❌ | ❌️ | ❌️ |
External Cache Directories | ✔️ | ❌ | ❌ | ❌️ | ❌️ |
External Storage Directories | ✔️ | ❌ | ❌ | ❌️ | ❌️ |
Downloads | ❌ | ✔️ | ✔️ | ✔️ | ✔️ |
path_provider
now uses a PlatformInterface
, meaning that not all platforms share a single PlatformChannel
-based implementation. With that change, tests should be updated to mock PathProviderPlatform
rather than PlatformChannel
.
See this path_provider
test for an example.