sceneFileToJson function

Map<String, Object?> sceneFileToJson(
  1. SceneDocument doc, {
  2. required String className,
  3. Map<String, MotionDocument> motions = const {},
})

A whole file as data: the scene, the class it is named after, and the motions that animate it.

Implementation

Map<String, Object?> sceneFileToJson(
  SceneDocument doc, {
  required String className,
  Map<String, MotionDocument> motions = const {},
}) => {
  'class': className,
  'scene': doc.toJson(),
  'motions': {for (var e in motions.entries) e.key: e.value.toJson()},
};