readableSize property

String get readableSize

Implementation

String get readableSize {
  if (sizeBytes < 0) return '';
  const kb = 1024;
  const mb = kb * 1024;

  if (sizeBytes >= mb) {
    return '${(sizeBytes / mb).toStringAsFixed(1)} MB';
  }
  return '${(sizeBytes / kb).toStringAsFixed(1)} KB';
}