path_provider: ^2.0.0 copied to clipboard
Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories.
A Flutter plugin for finding commonly used locations on the filesystem. Supports iOS, Android, Linux and MacOS. Not all methods are supported on all platforms.
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;
Please see the example app of this plugin for a full example.
Usage in tests #
path_provider now uses a
PlatformInterface, meaning that not all platforms share the a single
With that change, tests should be updated to mock
PathProviderPlatform rather than
path_provider test for an example.