createBackup method
Creates a backup of a file. Returns the backup file.
Implementation
Future<File> createBackup(File file) async {
if (!file.existsSync()) {
throw FileSystemException('File not found for backup', file.path);
}
return await file.copy('${file.path}.bak');
}