toMetadataJson method

Map<String, Object?> toMetadataJson({
  1. bool includePayload = false,
})

Implementation

Map<String, Object?> toMetadataJson({bool includePayload = false}) {
  return {
    'stage': stage.name,
    'completed': completed,
    'total': total,
    'remaining': remaining,
    'fraction': fraction,
    'isComplete': isComplete,
    'message': message,
    if (exportProgress != null)
      'exportProgress': exportProgress!.toMetadataJson(
        includePayload: includePayload,
      ),
    if (deliveryProgress != null)
      'deliveryProgress': deliveryProgress!.toMetadataJson(
        includePayload: includePayload,
      ),
  };
}