file_sizes 1.0.6 copy "file_sizes: ^1.0.6" to clipboard
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));
}
27
likes
160
pub points
91%
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