filesize function

String filesize(
  1. int bytes, [
  2. int round = 2,
  3. bool mustRound = false
])

Returns a formatted string value (such as "2 MB" and "2.34 KB") of given byte size.

Implementation

String filesize(int bytes, [int round = 2, bool mustRound = false]) {
  return _filesize(bytes, round: round, mustRound: mustRound, space: true);
}