markDirty method
Mark an already-mutated cached page dirty. Prefer getForWrite when possible — it captures the undo image automatically.
Implementation
Future<void> markDirty(int pageNo) async {
_ensureOpen();
final cached = _cache[pageNo];
if (cached == null) {
throw StateError('page $pageNo is not resident in cache');
}
await _captureForUndo(pageNo, cached);
_dirty.add(pageNo);
}