backupFile method

Future<void> backupFile(
  1. File file
)

Implementation

Future<void> backupFile(File file) async {
  final backupPath = '${file.path}.backup';
  try {
    await file.copy(backupPath);
  } catch (e) {
    throw AssetOptException('Failed to backup file ${file.path}: $e');
  }
}