tree: 7405464fce96a1a81c252916877a3e63730097dd [path history] [tgz]
  1. example/
  2. lib/
  3. test/
  4. AUTHORS
  5. CHANGELOG.md
  6. LICENSE
  7. pubspec.yaml
  8. README.md
packages/path_provider/path_provider/README.md

path_provider

pub package

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.

AndroidiOSLinuxmacOSWindows
SupportSDK 16+11.0+Any10.14+Windows 10+

Usage

To use this plugin, add path_provider as a dependency in your pubspec.yaml file.

Example

final Directory tempDir = await getTemporaryDirectory();

final Directory appDocumentsDir = await getApplicationDocumentsDirectory();

final Directory? downloadsDir = await getDownloadsDirectory();

Supported platforms and paths

Directories support by platform:

DirectoryAndroidiOSLinuxmacOSWindows
Temporary✔️✔️✔️✔️✔️
Application Support✔️✔️✔️✔️✔️
Application Library❌️✔️❌️✔️❌️
Application Documents✔️✔️✔️✔️✔️
External Storage✔️❌️❌️
External Cache Directories✔️❌️❌️
External Storage Directories✔️❌️❌️
Downloads✔️✔️✔️✔️

Testing

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.