StorageSpace constructor

StorageSpace({
  1. required int free,
  2. required int total,
  3. required int lowOnSpaceThreshold,
  4. required int fractionDigits,
})

Implementation

StorageSpace({
  required this.free,
  required this.total,
  required this.lowOnSpaceThreshold,
  required this.fractionDigits,
}) {
  used = total - free;
  freeSize = _toHuman(free, fractionDigits);
  totalSize = _toHuman(total, fractionDigits);
  usedSize = _toHuman(used, fractionDigits);
  usageValue = used / total;
  usagePercent = (usageValue * 100).round();
  lowOnSpace = free <= lowOnSpaceThreshold;
}