Skip to content
pubscout

path_provider

2.1.6, released 5 months ago by flutter.dev

Provides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.

Flutter FavoriteRock solid
$ flutter pub add path_provider
Source repository

What it does

The plugin exposes methods such as getTemporaryDirectory, getApplicationDocumentsDirectory, and getDownloadsDirectory to retrieve platform‑specific paths. It abstracts platform differences behind a unified Dart API.

AI-written summary of version 2.1.6, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to read or write files in standard app directories without handling platform‑specific path logic yourself
  • You require access to the downloads folder or external storage on Android

Skip it when

  • Your app only stores data in a key‑value store or database and doesn't need raw file paths
  • You need advanced file‑system features like picking files via UI dialogs

Strengths

  • Simple, well‑documented API
  • Supports all major desktop and mobile platforms
  • Handles platform nuances and null/UnsupportedError cases

Weaknesses

  • Only provides directory paths, not file‑picker UI
  • Requires native plugin setup for each platform

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
5

Add the package to pubspec.yaml; the plugin automatically registers native code. No additional permissions beyond platform defaults (e.g., Android storage permissions if accessing external storage).

final dir = await getApplicationDocumentsDirectory();
print('App docs dir: ${dir.path}');

Alternatives

Packages that do the same job and could replace path_provider.

  • open_file

    If you need to open files with associated apps rather than just obtain paths

Works with

Packages commonly used together with path_provider: ones it builds on, ones built on it, and its own family.