byte_converter library
Provides a simple interface for conversion of Digital values such as Bytes, KiloBytes etc.
This is the core export containing essential classes for most use cases.
Import Options:
// Core: sizes, rates, parsing, formatting, display/output/compare/
// accessibility/storage/rate namespaces, transfer planning
import 'package:byte_converter/byte_converter.dart';
// Everything above plus statistics, streaming, bit operations,
// validation, accumulators, interop and unit-name localization
import 'package:byte_converter/byte_converter_full.dart';
// Built-in locale number formatting (no extra dependency)
import 'package:byte_converter/byte_converter_lite.dart';
This package has no runtime dependencies. To format numbers with
package:intl, register a formatter with registerHumanizeNumberFormatter.
Classes
- BigByteConverter
- High-performance byte unit converter using BigInt for arbitrary precision.
- BigDataRate
- BigInt-precision data rate stored as bits per second.
- ByteAccessibility
- Provides accessibility-friendly output formats for byte values.
- ByteComparison
- Provides comparison and relationship utilities for byte values.
- ByteConverter
- High-performance byte unit converter with caching.
- ByteDelta
- Represents a signed change in bytes with arbitrary precision.
- ByteDisplayOptions
- Provides alternative display formats for byte values.
- ByteDistribution
- Represents a distribution result showing how bytes are allocated across parts.
- ByteDivisionNamespace
- Division namespace providing chunking and distribution utilities.
- ByteFormatOptions
- Reusable formatter options for humanizing sizes and transfer rates.
- ByteOutputFormats
- Provides structured output formats for programmatic use.
- BytePluralization
- Smart pluralization utilities for byte-related terms.
- ByteRange
- Inclusive-exclusive byte range [start, end) backed by BigInt.
- ChunkDivision
- Represents a division result showing how bytes are split into chunks.
- CompoundFormatOptions
- Options controlling compound mixed-unit formatting, e.g. "1 GiB 234 MiB 12 KiB".
- DataRate
- Represents a network/data rate. Internally stored as bits per second.
- HumanizeOptions
- Options that control how a byte value is humanized into text.
- NetworkOverhead
- Network overhead estimation utilities.
- NetworkRate
- Network rate utilities providing bits/bytes per second conversions and transfer time calculations.
- ParseError
- Structured error information produced by parse helpers.
-
ParseResult<
T> - Result wrapper for non-throwing parse helpers.
- PluralizationOptions
- Configuration for pluralization behavior.
- RateWindow
- Represents a window of rate over a time span, for planning variable schedules.
- StorageAlignment
- Describes a single alignment class within a StorageProfile.
- StorageNamespace
- Storage alignment utilities providing sector, block, page, and word calculations along with rounding and alignment checks.
- StorageProfile
- Defines storage alignment preferences used by byte converters when rounding to device-specific bucket sizes such as sectors, blocks, or pages.
- TransferPlan
- Simple transfer planning model for estimating ETAs and progress.
Enums
- BigSizeUnit
- Size units for BigByteConverter with support for larger SI magnitudes.
- ByteStandard
- Unit standards/prefix systems used for formatting and parsing.
- FormattingRoundingMode
- Rounding strategy for formatting numeric output.
- PluralizationRule
- Pluralization rules for different locales.
- RoundingMode
- Rounding modes for converting fractional values to integers.
- SiKSymbolCase
- Controls the letter-case of the SI kilo symbol for bytes. lowerK -> kB (preferred SI), upperK -> KB (legacy/JEDEC-style for some UIs).
- SizeUnit
- Byte size units for standard precision conversions (up to PB).
- UnitPolicy
- Hints to bias unit selection and standards automatically.
Extensions
- BigByteConverterNamespaces on BigByteConverter
- Extension providing namespace accessors for BigByteConverter.
- BigDataRatePlanning on BigDataRate
- Planning helpers for computing transferable bytes over a duration at a given BigDataRate. Methods avoid rounding drift by using integer math.
- BigIntByteConverterExtension on BigInt
- Extensions for BigInt to create BigByteConverter instances.
- ByteConverterNamespaces on ByteConverter
- Extension providing namespace accessors for ByteConverter.
- ByteConverterTransfer on ByteConverter
- ByteConverter helpers for transfer planning.
- ByteDivisionExtension on ByteConverter
- Extension providing division utilities on ByteConverter.
- DataRatePlanning on DataRate
- DataRate helpers for planning.
- DoubleByteConverterExtension on double
- Extensions for double to create ByteConverter instances.
- DoublePluralizationExtension on double
- Extension on double for quick pluralization.
- IntByteConverterExtension on int
- Extensions for int to create ByteConverter instances.
- IntPluralizationExtension on int
- Extension on int for quick pluralization.
- TransferPlanAdvanced on TransferPlan
- Advanced controls: schedules, pause/resume, and throttling.
- TransferPlanOverhead on TransferPlan
- Overhead-aware duration estimations.
Properties
- humanizeNumberFormatter → HumanizeNumberFormatter?
-
Returns the currently registered humanize number formatter, if any.
no setter
Functions
-
clearHumanizeNumberFormatter(
) → void - Clears any previously registered number formatter.
-
registerHumanizeNumberFormatter(
HumanizeNumberFormatter formatter) → void -
Registers a global number formatter used by humanize to render the numeric
portion of the output. Pass
nullvia clearHumanizeNumberFormatter to restore the default formatting behavior.
Typedefs
- HumanizeNumberFormatter = String Function(double value, HumanizeOptions options)
- Signature for a number formatter used by the humanize pipeline.