save method

Future<void> save({
  1. VfsAdapter? vfs,
})

Implementation

Future<void> save({VfsAdapter? vfs}) async {
  final adapter = vfs ?? _vfs;
  if (adapter == null) return; // no VFS configured → skip persistence
  final json = const JsonEncoder.withIndent('  ').convert(root.toJson());
  await adapter.writeAll(path, Uint8List.fromList(utf8.encode(json)));
}