file_sizes 1.0.6
file_sizes: ^1.0.6 copied to clipboard

Get the Human readable size of the file. It is purely written in dart and support both number and string as parameters.

example/main.dart

import 'package:file_sizes/file_sizes.dart';

void main() {
  /// Integer Values
  ///
  /// 12.06 KB
  print(FileSize.getSize(12345));

  /// 12.06 KB
  print(FileSize.getKiloBytes(12345));

  /// 12.05566 KB
  print(FileSize.getKiloBytes(12345, value: PrecisionValue.Five));

  /// 96450.712 KB
  print(FileSize.getKiloBytes(98765532, value: PrecisionValue.Three));

  /// String Values
  ///
  /// 12.06 KB
  print(FileSize.getSize('12345'));

  /// 12.06 KB
  print(FileSize.getKiloBytes('12345'));

  /// 12.05566 KB
  print(FileSize.getKiloBytes('12345', value: PrecisionValue.Five));

  /// 96450.712 KB
  print(FileSize.getKiloBytes('98765532', value: PrecisionValue.Three));
}
18
likes
130
pub points
73%
popularity

Publisher

anmolsethi.dev

Get the Human readable size of the file. It is purely written in dart and support both number and string as parameters.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on file_sizes