checkFile method

Future<bool> checkFile(
  1. File file
)

Checks a file with a manifest file.

Implementation

Future<bool> checkFile(File file) async {
  if (!file.existsSync()) return false;

  var length = file.lengthSync();
  if (length != this.length) return false;

  var data = file.readAsBytesSync();
  var dataSHA256 = data.computeSHA256();

  return sha256.equals(dataSHA256);
}