delete method

  1. @override
Future<bool> delete(
  1. String key
)
override

Deletes a snapshot from storage.

Parameters:

  • key: The key/identifier of the snapshot to delete

Returns: A Future that completes with true if the snapshot was deleted, false if it didn't exist.

Implementation

@override
Future<bool> delete(String key) async {
  await _ensureDirectory();

  final file = _getFile(key);
  if (!await file.exists()) {
    return false;
  }

  try {
    await file.delete();
    debugPrint('[Checkpoint] Deleted snapshot: ${file.path}');
    return true;
  } catch (e) {
    debugPrint('[Checkpoint] Error deleting snapshot ${file.path}: $e');
    return false;
  }
}