toReadableBytes property

String get toReadableBytes

Implementation

String get toReadableBytes {
  if (this < 0) {
    return "-1 B";
  }
  if (this <= 1000) {
    return "$this B";
  }
  if (this <= 1000000) {
    return "${(this / 1000).formattedString} kB";
  }

  return "${(this / 1000000).formattedString} MB";
}