toJson method

  1. @override
Map<String, Object?> toJson()
override

Must include path; the rest is whatever the plugin needs.

Implementation

@override
Map<String, Object?> toJson() => {
  ...super.toJson(),
  if (directory != null) 'directory': directory,
  if (previewAnnotations != null) 'previewAnnotations': previewAnnotations,
  if (device != null) 'device': device!.id,
  if (orientation != null) 'orientation': orientation!.name,
  if (canvases.isNotEmpty) 'canvases': [for (var c in canvases) c.toJson()],
  if (setup != null) 'setup': setup,
};