file_sizes 1.0.5 copy "file_sizes: ^1.0.5" to clipboard
file_sizes: ^1.0.5 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));
}
26
likes
130
pub points
90%
popularity

Publisher

verified publisheranmolsethi.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