toWire method

Map<String, dynamic> toWire()

Implementation

Map<String, dynamic> toWire() => {
      'type': 'ui_diff',
      'screen': screen,
      'captured_at': newCapturedAt.toIso8601String(),
      if (oldCapturedAt != null)
        'previous_captured_at': oldCapturedAt!.toIso8601String(),
      if (isBaseline) 'baseline': true,
      if (added.isNotEmpty) 'added': [for (final a in added) a.toWire()],
      if (removed.isNotEmpty) 'removed': removed,
      if (updated.isNotEmpty)
        'updated': [for (final u in updated) u.toWire()],
      if (moved.isNotEmpty) 'moved': [for (final m in moved) m.toWire()],
      if (visibilityChanged.isNotEmpty)
        'visibility_changed': [
          for (final v in visibilityChanged) v.toWire(),
        ],
    };