disk_capacity 1.0.1 copy "disk_capacity: ^1.0.1" to clipboard
disk_capacity: ^1.0.1 copied to clipboard

A Flutter package to get information about the disk capacity of Android and iOS devices.

disk_capacity #

A Flutter plugin to get free and total disk space on Android and iOS.

Note

This plugin is inspired by disk_space package from Marvin Böddeker, no longer maintained.

Installation #

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

dependencies:
  disk_capacity: ^1.0.0

Then run

flutter pub get

Usage #

import 'package:disk_capacity/disk_capacity.dart';

void main() async {
    final DiskCapacity diskCapacity = DiskCapacity();
    double freeSpace = await diskCapacity.getFreeDiskSpace();
    double totalSpace = await diskCapacity.getTotalDiskSpace();
    double freeSpaceForPath = await diskCapacity.getFreeDiskSpaceForPath('/path/to/directory');
    double totalSpaceForPath = await diskCapacity.getTotalDiskSpaceForPath('/path/to/directory');

    print('Free space: $freeSpace MB');
    print('Total space: $totalSpace MB');
    print('Free space for path: $freeSpaceForPath MB');
    print('Total space for path: $totalSpaceForPath MB');
}

Contributing #

If you have any questions or ideas, please feel free to contact me or open an issue to discuss it.

License #

This project is licensed under the MIT

1
likes
160
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to get information about the disk capacity of Android and iOS devices.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on disk_capacity

Packages that implement disk_capacity