writeTimelineToFile method

Future<void> writeTimelineToFile (String traceName, { String destinationDirectory, bool pretty: false })

Writes all of the recorded timeline data to a file.

Implementation

Future<void> writeTimelineToFile(
  String traceName, {
  String destinationDirectory,
  bool pretty = false,
}) async {
  destinationDirectory ??= testOutputsDirectory;
  await fs.directory(destinationDirectory).create(recursive: true);
  final File file = fs.file(path.join(destinationDirectory, '$traceName.timeline.json'));
  await file.writeAsString(_encodeJson(_timeline.json, pretty));
}