toWire method

Object? toWire(
  1. Object? value
)

The value as the wire and the authored JSON carry it.

Implementation

Object? toWire(Object? value) => switch (kind) {
  ScenePropKind.color => (value as SceneColor?)?.argb,
  ScenePropKind.size => sizeToWire(value as double?),
  ScenePropKind.sizes => [
    for (var c in value! as List<double?>) sizeToWire(c),
  ],
  ScenePropKind.layers => [
    for (var l in value! as List<TextLayer>) l.toWire(),
  ],
  ScenePropKind.axes => {...value! as Map<String, double>},
  ScenePropKind.edges => (value! as SceneQuad).toWire(),
  ScenePropKind.choice => value == null ? null : choices!.toWire(value),
  _ => value,
};