addSection method
Add a section to a memory file.
Implementation
Future<MemoryFile> addSection(
String path, {
required String heading,
required String content,
int level = 2,
}) async {
final existing = _files[path];
final currentContent = existing?.content ?? '';
final newSection = '\n\n${'#' * level} $heading\n\n$content';
final updated = currentContent + newSection;
return save(path, updated);
}