xdg_directories 0.1.0

  • Readme
  • Changelog
  • Installing
  • 79

xdg_directories #

A Dart package for reading XDG directory configuration information on Linux.

Getting Started #

On Linux, xdg is a system developed by freedesktop.org, a project to work on interoperability and shared base technology for free software desktop environments for Linux.

This Dart package can be used to determine the directory configuration information defined by xdg, such as where the Documents or Desktop directories are. These are called "user directories" and are defined in configuration file in the user's home directory.

See this wiki for more details of the XDG Base Directory implementation.

To use this package, the basic XDG values for the following are available via a Dart API:

  • dataHome - The single base directory relative to which user-specific data files should be written. (Corresponds to $XDG_DATA_HOME).

  • configHome - The a single base directory relative to which user-specific configuration files should be written. (Corresponds to $XDG_CONFIG_HOME).

  • dataDirs - The list of preference-ordered base directories relative to which data files should be searched. (Corresponds to $XDG_DATA_DIRS).

  • configDirs - The list of preference-ordered base directories relative to which configuration files should be searched. (Corresponds to $XDG_CONFIG_DIRS).

  • cacheHome - The base directory relative to which user-specific non-essential (cached) data should be written. (Corresponds to $XDG_CACHE_HOME).

  • runtimeDir - The base directory relative to which user-specific runtime files and other file objects should be placed. (Corresponds to $XDG_RUNTIME_DIR).

  • getUserDirectoryNames() - Returns a set of the names of user directories defined in the xdg configuration files.

  • getUserDirectory(String dirName) - Gets the value of the user dir with the given name. Requesting a user dir that doesn't exist returns null. The dirName argument is case-insensitive. See this wiki for more details and what values of dirName might be available.

[0.1.0] - Initial Release #

  • Initial release includes all the features described in the README.md

Use this package as a library

1. Depend on it

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


dependencies:
  xdg_directories: ^0.1.0

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:xdg_directories/xdg_directories.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
61
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

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

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and xdg_directories.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
flutter 0.0.0
path ^1.6.4 1.7.0
process ^3.0.12 3.0.13
Transitive dependencies
collection 1.14.12
file 5.1.0
intl 0.16.1
meta 1.1.8
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
mockito ^4.1.1