checkLatest function
Implementation
checkLatest(String fileName, String downloadPath, String path) async {
final File file =
File(<String>{path, 'www', fileName}.join(Platform.pathSeparator));
DateTime lastModified = await file.lastModified();
Duration difference = DateTime.now().difference(lastModified);
//print(difference);
if (difference.inDays > 1) {
await file.delete();
await downloadFile(fileName, downloadPath, path);
}
return;
}