save method

Future<void> save()

Saves the graph to disk for future use.

This persists the current state of the graph to improve build performance in subsequent runs.

Implementation

Future<void> save() async {
  final File file = AssetsGraph.cacheFile;
  if (!file.existsSync()) {
    file.createSync(recursive: true);
  }
  await file.writeAsString(jsonEncode(toJson()));
}