formatByteSize function

String formatByteSize(
  1. int? bytes
)

Formats bytes as a decimal byte size, for example 1.5 MB.

Returns - when bytes is null.

Implementation

String formatByteSize(final int? bytes) {
  if (bytes == null) {
    return '-';
  }
  return ByteSizeFormatter.format(bytes);
}