getStorageSpace function

Future<StorageSpace> getStorageSpace({
  1. required int lowOnSpaceThreshold,
  2. required int fractionDigits,
})

Returns the storage space for the device

Implementation

Future<StorageSpace> getStorageSpace({
  /// Threshold in Bytes for showing `lowOnSpace`
  required int lowOnSpaceThreshold,

  /// Number of digits to use for the Human Readable values
  required int fractionDigits,
}) async {
  int free = await _invokeMethodInt('getFreeSpace');
  int total = await _invokeMethodInt('getTotalSpace');
  return StorageSpace(
    free: free,
    total: total,
    lowOnSpaceThreshold: lowOnSpaceThreshold,
    fractionDigits: fractionDigits,
  );
}