file_sizes 1.0.2 copy "file_sizes: ^1.0.2" to clipboard
file_sizes: ^1.0.2 copied to clipboard

outdated

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() {
  /// Initialze [FileSize] Class
  FileSize fileSize = FileSize();

  /// 12.35 KB
  print(fileSize.getSize(12345));

  /// 12.35 KB
  print(fileSize.getKiloBytes(12345));

  /// 12.34500 KB
  print(fileSize.getKiloBytes(12345, value: PrecisionValue.Five));

  /// 98765.532 KB
  print(fileSize.getKiloBytes(98765532, value: PrecisionValue.Three));

  /// 98765.532 KB
  print(fileSize.getPetaBytes(9876522532, value: PrecisionValue.Six));
}
27
likes
0
points
1.55k
downloads

Publisher

verified publisheranmolsethi.dev

Weekly Downloads

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

License

unknown (license)

More

Packages that depend on file_sizes