formattedSize property

String get formattedSize

Format bytes as human readable string

Implementation

String get formattedSize {
  if (totalBytes < 1024) return '$totalBytes B';
  if (totalBytes < 1024 * 1024) {
    return '${(totalBytes / 1024).toStringAsFixed(1)} KB';
  }
  return '${(totalBytes / (1024 * 1024)).toStringAsFixed(2)} MB';
}