convertToJson static method
convert from ThreatScore List to threatScore json
Implementation
static String convertToJson(List<ThreatScore> threatScores) {
try {
List<Map<String, dynamic>> jsonData =
threatScores.map((threatScore) => threatScore.toJson()).toList();
return jsonEncode(jsonData);
} on FormatException {
throw CustomFormatException(
message: "Fails to Convert List<ThreatScore> $threatScores to json");
}
}