toJson method
Implementation
@visibleForTesting
Map<String, dynamic> toJson() => {
"detection": detection?.toJson(),
"allDetections": allDetections?.map((e) => e.toJson()).toList(),
"scenario": scenario?.value,
"error": error?.toJson(),
}.clearNulls();