xdg_directories
1.1.0, released 2 years ago by flutter.dev
A Dart package for reading XDG directory configuration information on Linux.
What it does
Provides a Dart API to determine XDG user directories and base directories on Linux. Allows reading values like dataHome, configHome, cacheHome, runtimeDir, stateHome, and user directories.
AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are developing a Linux-targeted Dart or Flutter application that needs to follow XDG base directory standards
- You need to locate user-specific configuration, data, or cache directories on Linux
Skip it when
- Your application targets platforms other than Linux where XDG directories are not used
- You require cross-platform path resolution without platform-specific checks
Strengths
- Directly supports XDG specification base and user directories
- Simple, function-based API
Weaknesses
- Linux-only package
- Limited to reading configuration information
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
No special setup required beyond adding the dependency.
import 'package:xdg_directories/xdg_directories.dart' as xdg;
void main() {
final configDir = xdg.configHome;
print('Config Home: $configDir');
}Alternatives
Packages that do the same job and could replace xdg_directories.
- path_provider
If you need cross-platform directory resolution (Android, iOS, Linux, macOS, Windows) instead of Linux-specific XDG directories.
93Compare
Works with
Packages commonly used together with xdg_directories: ones it builds on, ones built on it, and its own family.
- flutter_local_notifications_linuxBuilt on xdg_directoriesLinux implementation of the flutter_local_notifications plugin.
- gsettingsBuilt on xdg_directoriesClient to access GSettings database for storing user preferences on Linux.
- native_storageBuilt on xdg_directoriesUnified API for native key-value storage across platforms