Search packages, repositories and app categories

Package detailsv2.0.1

filesize

A package to get humanized file sizes. Translate raw file size into human readable strings.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
38.2K
Likes
182
Pub points
160

Install package

flutter pub add filesize

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The filesize package provides a simple way to convert raw file sizes into human-readable formats, such as '1.2 MB' or '3.4 GB'. It is ideal for displaying file sizes in user interfaces across multiple platforms. The package supports various units and offers customizable options for precision and formatting. It is lightweight and easy to integrate into Flutter applications.

Use cases

  • Displaying file sizes in app UIs
  • Converting byte values to readable strings
  • Showing storage usage in dashboards
  • Formatting file size data for users
  • Enhancing user experience with clear metrics

Key features

  • Converts bytes to human-readable strings
  • Supports multiple unit formats
  • Customizable precision and suffixes
  • Lightweight and efficient
  • Cross-platform compatibility

Suitable for

  • Developers building file management apps
  • Apps requiring user-friendly size displays
  • Tools that show storage statistics
  • Educational or productivity apps
  • Projects targeting Android, iOS, Web, macOS, Windows, and Linux

Considerations

  • May require manual handling of edge cases like zero bytes
  • Limited to size formatting—no file operations
  • Does not support locale-specific formatting out of the box
  • No built-in support for binary vs decimal units (e.g., KiB vs KB)

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Filesize

pub package Build Status Coverage Status

A micro library that provides an easy way to get human readable file size strings

Features

  • Size can be passed as number or as string
  • Optional parameter to specify numbers of digits after comma/point

Examples

filesize(1024);                   // "1 KB"
filesize(664365320);              // "633.59 MB"
filesize(4324324232343);          // "3.93 TB"

Optional parameter to specify numbers after comma/point:

filesize(664365320, 4);          // "633.5881 MB"
filesize(4324324232343, 3);      // "3.932 TB"

Inspired by filesize.js

Categories

Source repository

Projects using this package