Overview
The file_sizes package is a pure Dart utility that converts file sizes into human-readable formats. It supports both numeric and string inputs, making it easy to display file sizes in a user-friendly way across platforms. Ideal for apps needing size representation in bytes, kilobytes, megabytes, etc., it works seamlessly on Android, iOS, Web, macOS, Windows, and Linux without native dependencies. The package is lightweight and efficient, designed for simplicity and broad compatibility.
Use cases
- Displaying file sizes in app UIs
- Converting byte values to readable formats
- Integrating size labels in file managers
- Supporting file upload/download progress displays
- Showing storage usage statistics
Key features
- Pure Dart implementation
- Supports both number and string inputs
- Cross-platform compatibility
- No native code required
- Simple and lightweight API
- Automatic unit selection based on size
Suitable for
- Developers building file management apps
- UI designers needing formatted size labels
- Apps with file upload/download features
- Cross-platform Flutter projects
- Lightweight size formatting needs
Considerations
- Does not handle file system operations
- Only formats size values, does not read files
- Requires manual input of file size values
- Not suitable for large-scale file analysis
- Limited to size representation, not file metadata