byte_converter 2.6.0 copy "byte_converter: ^2.6.0" to clipboard
byte_converter: ^2.6.0 copied to clipboard

High-performance byte and data-rate conversions with BigInt precision, expression parsing, transfer planning, storage profiles, and localization-ready formatting.

πŸ”’ ByteConverter #

A fast, comprehensive byte & data-rate conversion library for Dart

Pub Version License: MIT Dart 3

πŸ“– Documentation Β· πŸ› Report Bug Β· πŸ’‘ Request Feature


✨ Features #

Feature Description
πŸ“ Multi-Standard SI (KB, MB, GB), IEC (KiB, MiB, GiB), and JEDEC support
πŸ” Smart Parsing Parse any format: "1.5 GB", "2 GiB + 512 MiB", "1,234 bytes"
πŸ”’ BigInt Support Arbitrary precision for massive values (YB, ZiB, and beyond)
πŸš€ Data Rates Full bits/bytes per second with transfer time estimation
🌍 9 Languages Built-in localization: EN, DE, FR, ES, PT, HI, JA, ZH, RU
🎯 Clean API Namespace-based: display, storage, rate, compare, accessibility
β™Ώ Accessible Screen reader friendly output & ARIA labels
πŸ“Š Statistics Streaming quantiles, percentiles, and aggregation

πŸš€ Quick Start #

Installation #

dependencies:
  byte_converter: ^2.5.0

Basic Usage #

import 'package:byte_converter/byte_converter.dart';

void main() {
  // πŸ“¦ Create from any unit
  final size = ByteConverter.fromGigaBytes(1.5);
  
  // 🎨 Display formats
  print(size.display.auto());    // "1.5 GB"
  print(size.display.fuzzy());   // "about 1.5 GB"
  print(size.display.gnu());     // "1.5G"
  
  // πŸ” Parse strings (even expressions!)
  final parsed = ByteConverter.parse('2 GiB + 512 MiB');
  print(parsed.gigaBytes);       // 2.68...
  
  // πŸš€ Data rates & transfer estimation
  final rate = DataRate.parse('100 Mbps');
  final plan = size.estimateTransfer(rate);
  print(plan.etaString());       // "~2 minutes"
}

πŸ“¦ Import Options #

// 🎯 Core (most use cases)
import 'package:byte_converter/byte_converter.dart';

// πŸ”₯ Full (statistics, streaming, interop)
import 'package:byte_converter/byte_converter_full.dart';

// 🌍 Localization (with intl package)
import 'package:byte_converter/byte_converter_intl.dart';

// πŸͺΆ Lightweight (no intl dependency)
import 'package:byte_converter/byte_converter_lite.dart';

🎯 Namespace API #

final size = ByteConverter.fromMegaBytes(1536);

// 🎨 Display - formatting options
size.display.auto()        // "1.5 GB"
size.display.fuzzy()       // "about 1.5 GB"
size.display.scientific()  // "1.5 Γ— 10⁹ B"

// πŸ’Ύ Storage - disk alignment
size.storage.sectors       // 3000000 (512B sectors)
size.storage.blocks        // 375000 (4KB blocks)

// πŸ“‘ Rate - network calculations
size.rate.bitsPerSecond    // 12884901888.0
size.rate.transferTime(rate) // Duration

// πŸ“Š Compare - size comparisons
size.compare.percentOf(total)     // 15.0
size.compare.percentageBar(total) // "β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘"

// β™Ώ Accessibility
size.accessibility.screenReader() // "one point five gigabytes"

πŸ“š Documentation #

Resource Description
πŸ“– Wiki Full documentation
🏁 Getting Started Installation & setup
πŸ“ Usage Guide Core functionality
🧰 Utilities Advanced features
πŸ”„ Migration Guide Upgrading to v2.5.0

Made with ❀️ for the Dart community

⭐ Star on GitHub Β· πŸ“¦ View on pub.flutter-io.cn

7
likes
140
points
4.97k
downloads

Publisher

verified publisherarunprakashg.com

Weekly Downloads

High-performance byte and data-rate conversions with BigInt precision, expression parsing, transfer planning, storage profiles, and localization-ready formatting.

Repository (GitHub)
View/report issues

Topics

#bytes #data-conversion #unit-conversion #formatting #bigint

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

intl

More

Packages that depend on byte_converter