path_provider 2.1.5 copy "path_provider: ^2.1.5" to clipboard
path_provider: ^2.1.5 copied to clipboard

Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories.

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.

Android iOS Linux macOS Windows
Support SDK 16+ 12.0+ Any 10.14+ Windows 10+

Example #

final Directory tempDir = await getTemporaryDirectory();

final Directory appDocumentsDir = await getApplicationDocumentsDirectory();

final Directory? downloadsDir = await getDownloadsDirectory();

Supported platforms and paths #

Directories support by platform:

Directory Android iOS Linux macOS Windows
Temporary ✔️ ✔️ ✔️ ✔️ ✔️
Application Support ✔️ ✔️ ✔️ ✔️ ✔️
Application Library ❌️ ✔️ ❌️ ✔️ ❌️
Application Documents ✔️ ✔️ ✔️ ✔️ ✔️
Application Cache ✔️ ✔️ ✔️ ✔️ ✔️
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.

5.1k
likes
160
points
3.89M
downloads

Publisher

verified publisherflutter.dev

Weekly Downloads

Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories.

Repository (GitHub)
View/report issues
Contributing

Topics

#files #path-provider #paths

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, path_provider_android, path_provider_foundation, path_provider_linux, path_provider_platform_interface, path_provider_windows

More

Packages that depend on path_provider