Skip to content

Flutter Plugin. Get the free, available and total storage space for the device. Utility helpers for readable sizes

License

Notifications You must be signed in to change notification settings

Htryhard/storage_space

 
 

Repository files navigation

Storage Space

Get the free, available and total disk space for the device.

The StorageSpace model contains values in bytes and human-readable versions.

The lowOnSpace flag shows when the device is low on space. The threshhold is up to you.

Usage

StorageSpace freeSpace = await getStorageSpace(
  lowOnSpaceThreshold: 2 * 1024 * 1024 * 1024, // 2GB
  fractionDigits: 1, // How many digits to use for the human-readable values
);

Example

The example directory shows how to use StorageSpace package to render a "progress meter" that renders a warning when the device is low on space

Background

This package is a reworking of disk_space and storage_capacity.

The reworking adds null-safety, as well as some convenience features:

  • A single method-call for all properties in a StorageSpace class
  • All values in bytes and human-readable, ie: 12.1 MB, 8 GB, 1.5 TB etc.
  • Usage as a percent
  • A flag to show if the system is low-on-space. The threshold is user-defined

Take a peek at the StorageSpace class in the API reference for more details.

About

Flutter Plugin. Get the free, available and total storage space for the device. Utility helpers for readable sizes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 47.6%
  • Kotlin 19.9%
  • Ruby 16.1%
  • Swift 11.3%
  • Objective-C 5.1%