universal_disk_space
0.2.3, released 5 years ago by an unverified publisher
Parses total and available disk spaces on Windows and UNIX-based systems
Unverified publisher
What it does
Parses total and available disk spaces on Windows and UNIX-based systems, including Linux and macOS. It allows scanning for disks, retrieving their mount paths, device paths, and space metrics, and querying specific directories.
AI-written summary of version 0.2.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to check available or total disk space on desktop or mobile systems
- You want to find which disk a specific directory or FileSystemEntity belongs to
Skip it when
- You need general key-value or local database storage rather than disk space statistics
Strengths
- Supports both Windows and UNIX-based systems like Linux and macOS
- Easy-to-use API for scanning and inspecting storage devices
Weaknesses
- Platform parsing relies on system commands which may behave differently across environments
- macOS support was historically noted as untested
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add the dependency to pubspec.yaml and import universal_disk_space.
import 'dart:io';
import 'package:universal_disk_space/universal_disk_space.dart';
Future<void> main() async {
final diskSpace = DiskSpace();
await diskSpace.scan();
for (final disk in diskSpace.disks) {
print(disk.devicePath);
print(disk.totalSize);
}
}Works with
Packages commonly used together with universal_disk_space: ones it builds on, ones built on it, and its own family.