getFileChecksum static method

Future<String> getFileChecksum({
  1. required String filePath,
})

Calculates the MD5 checksum of a file

  • filePath: Absolute file path

Throws a FileSystemException if the file does not exist. Throws a PlatformException if some other error occurs.

Implementation

static Future<String> getFileChecksum({
  required String filePath,
}) async {
  final fileExists = File(filePath).existsSync();
  if (!fileExists) throw FileSystemException("File does not exist", filePath);

  return await _api.getFileChecksum(filePath);
}