file_sizes 1.0.1 file_sizes: ^1.0.1 copied to clipboard
Get the Human readable size of the file. It is purely written in dart and support both number and string as parameter and number.
import 'package:file_sizes/file_sizes.dart';
void main() {
int baseNumber = 1024;
/// Get KiloBytes
String bytes = FileSize.getSize(baseNumber);
print(bytes);
/// Get MegaBytes
String megabytes = FileSize.getSize(baseNumber * baseNumber);
print(megabytes);
}