toJson method
Converts this WebPredictionResult to a JSON map.
Used for serializing prediction results for storage or further processing.
Implementation
Map<String, dynamic> toJson() {
return {
'id': id,
'scientific_name': scientificName,
'probabilities': probabilities,
'model_id': modelId,
'confidence': confidence,
if (imageUrlSpecies != null) 'image_url_species': imageUrlSpecies,
};
}