Flutter plugin for finding commonly used locations on the device's file system
open sourceBSD-3-Clausefree
path_provider is the Flutter team's plugin for getting the standard directories an app writes to on each platform: the temporary, application support, documents, cache and downloads directories, plus the library directory on iOS and macOS and the external storage directories on Android. It returns each as a Dart Directory, so files can be read and written there with dart:io. It's a federated plugin, with an implementation package for Android, iOS and macOS, Linux and Windows. It's part of the flutter/packages repository and published on pub.dev by flutter.dev.
Problems it solves
- where should my Flutter app save files on the phone
- get the app's documents directory on Android and iOS from Dart
- find a temporary or cache folder to write files to in my Flutter app
- save downloaded files to the user's downloads folder from a Flutter desktop app
- store app data in the right place on Windows, macOS and Linux from Flutter
Features
- Temporary, application support, documents and cache directories
- Downloads directory on every supported platform
- Library directory on iOS and macOS
- External storage and external cache directories on Android
- Android, iOS, Linux, macOS and Windows
Limitations
- Doesn't support Flutter web: it covers Android, iOS, Linux, macOS and Windows, and not every directory exists on every platform1
Alternatives
The same job
These do what path_provider does.
- Flutter Packages Flutter's first-party packages and plugins, maintained by the Flutter team
- open_file Flutter plugin that opens a file in the device's native app
