large Flutter Favorite logosmall Flutter Favorite logo

path_provider 2.0.11 icon indicating copy to clipboard operation
path_provider: ^2.0.11 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.

AndroidiOSLinuxmacOSWindows
SupportSDK 16+9.0+Any10.11+Windows 10+

Usage #

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

Example #

Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;

Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;

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.

3041
likes
130
pub points
100%
popularity

Publisher

verified publisher iconflutter.dev

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

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

flutter, path_provider_android, path_provider_ios, path_provider_linux, path_provider_macos, path_provider_platform_interface, path_provider_windows

More

Packages that depend on path_provider