Giter VIP home page Giter VIP logo

storage_space's Introduction

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.

storage_space's People

Contributors

oodavid avatar bonnyfone avatar speerj avatar

Forkers

reymai

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.