toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
  'changed': double.parse(diff.fraction.toStringAsFixed(5)),
  'sizeChanged': diff.sizeChanged,
  'width': diff.width,
  'height': diff.height,
  // The eye's jump targets and an agent's coordinates, and capped: a
  // repainted background is thousands of one-pixel specks, and a reader
  // wants the regions rather than the confetti.
  'clusters': [for (var rect in diff.clusters.take(24)) rect.toJson()],
  if (diff.clusters.length > 24) 'clustersDropped': diff.clusters.length - 24,
};