disk 0.0.1
disk: ^0.0.1 copied to clipboard
A new flutter plugin project.
Disk #
A flutter plugin for android to get storage volumes' information.
Add package from github #
dependencies:
disk:
git:
url: git://github.com/0xba1/disk
ref: main
Example #
import 'package:disk/disk.dart';
String path = "/sdcard/";
int totalSpace = Disk.getTotalBytes(path);
int freeSpace = Disk.getUsedBytes(path);
int usedSpace = totalSpace - freeSpace;
// To get paths of all mounted `StorageVolumes`
// For SDK 30 and above
// [{"path": path, "name": name}, {"path": path, "name": name}]
List<Map<String, String>> storageVolumes = Disk.getStorageVolumes();
for storageVolume in storageVolumes {
print("name: ${storageVolume["name"]}, path: ${storageVolume["path"]}");
}