restoreBackup method

Future<void> restoreBackup(
  1. String originalPath
)

Implementation

Future<void> restoreBackup(String originalPath) async {
  final backupFile = File('$originalPath.backup');
  final originalFile = File(originalPath);

  try {
    if (await backupFile.exists()) {
      await backupFile.copy(originalPath);
      await backupFile.delete();
    }
  } catch (e) {
    throw AssetOptException('Failed to restore backup for $originalPath: $e');
  }
}