path_provider_linux 0.0.1+2

  • Readme
  • Changelog
  • Example
  • Installing
  • 95

path_provider_linux #

The linux implementation of [path_provider].

Please set your constraint to path_provider: '>=0.0.y+x <2.0.0'

Backward compatible 1.0.0 version is coming #

The path_provider plugin has reached a stable API, we guarantee that version 1.0.0 will be backward compatible with 0.0.y+z. Please use path_provider: '>=0.0.y+x <2.0.0' as your dependency constraint to allow a smoother ecosystem migration. For more details see:

Usage #

This package is already included as part of the path_provider package dependency, and will be included when using path_provider as normal. You will need to use version 1.6.10 or newer.

0.0.1+2 #

  • This release updates the example to depend on the endorsed plugin rather than relative path

0.0.1+1 #

  • This updates the readme and pubspec and example to reflect the endorsement of this implementation of path_provider

0.0.1 #

  • The initial implementation of path_provider for Linux
    • Implements getApplicationSupportPath, getApplicationDocumentsPath, getDownloadsPath, and getTemporaryPath


import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';

void main() async {

/// Sample app
class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  String _tempDirectory = 'Unknown';
  String _downloadsDirectory = 'Unknown';
  String _appSupportDirectory = 'Unknown';
  String _documentsDirectory = 'Unknown';

  void initState() {

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initDirectories() async {
    String tempDirectory;
    String downloadsDirectory;
    String appSupportDirectory;
    String documentsDirectory;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      tempDirectory = (await getTemporaryDirectory()).path;
    } on PlatformException {
      tempDirectory = 'Failed to get temp directory.';
    try {
      downloadsDirectory = (await getDownloadsDirectory()).path;
    } on PlatformException {
      downloadsDirectory = 'Failed to get downloads directory.';

    try {
      documentsDirectory = (await getApplicationDocumentsDirectory()).path;
    } on PlatformException {
      documentsDirectory = 'Failed to get documents directory.';

    try {
      appSupportDirectory = (await getApplicationSupportDirectory()).path;
    } on PlatformException {
      appSupportDirectory = 'Failed to get documents directory.';
    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _tempDirectory = tempDirectory;
      _downloadsDirectory = downloadsDirectory;
      _appSupportDirectory = appSupportDirectory;
      _documentsDirectory = documentsDirectory;

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Path Provider Linux example app'),
        body: Center(
          child: Column(
            children: [
              Text('Temp Directory: $_tempDirectory\n'),
              Text('Documents Directory: $_documentsDirectory\n'),
              Text('Downloads Directory: $_downloadsDirectory\n'),
              Text('Application Support Directory: $_appSupportDirectory\n'),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  path_provider_linux: ^0.0.1+2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:path_provider_linux/path_provider_linux.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform android

Because of import path [package:path_provider_linux/path_provider_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform ios

Because of import path [package:path_provider_linux/path_provider_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform macos

Because of import path [package:path_provider_linux/path_provider_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform web

Because of import path [package:path_provider_linux/path_provider_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform windows

Because of import path [package:path_provider_linux/path_provider_linux.dart] that declares support for platforms: linux

Package not compatible with SDK dart

because of import path [path_provider_linux] that is in a package requiring null.

Maintenance suggestions

The package description is too short. (-12 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
path ^1.6.4 1.7.0
path_provider_platform_interface ^1.0.1 1.0.2
xdg_directories ^0.1.0 0.1.0
Transitive dependencies
collection 1.14.12 1.14.13
file 5.2.1
intl 0.16.1
meta 1.1.8
platform 2.2.1
plugin_platform_interface 1.0.2
process 3.0.13
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
pedantic ^1.8.0