ByteConverter

available on Pub

Provides a simple interface for conversion of Digital values such as Bytes, KiloBytes etc. This library is a based on ByteSize library available on C# dotnet platforms which i am a huge fan off.

Created from templates made available by Stagehand under a BSD-style license.

Usage

A simple usage example:

import 'package:byte_converter/byte_converter.dart';

main() {
  double bytes = 100000;

  ByteConverter converter = ByteConverter(bytes);
  print('$bytes bytes is ${converter.kiloBytes} Kb');
  print('$bytes bytes is ${converter.megaBytes} Mb');
  print('$bytes bytes is ${converter.gigaBytes} Gb');
  print('$bytes bytes is ${converter.teraBytes} Tb');

  // or

  double gigaByte = 70.5;
  converter = ByteConverter.fromGigaBytes(gigaByte);
  print('$bytes bytes is ${converter.kiloBytes} Kb');
  print('$bytes bytes is ${converter.megaBytes} Mb');
  print('$bytes bytes is ${converter.gigaBytes} Gb');
  print('$bytes bytes is ${converter.teraBytes} Tb');
}

License

This project is licensed under MIT License. Read about it here: MIT License

Features and bugs

Please file feature requests and bugs here issue tracker.

Libraries

byte_converter
Provides a simple interface for conversion of Digital values such as Bytes, KiloBytes etc