ingredientsToJson static method
Returns a JSON map from Ingredients
Implementation
static List<Map<String, dynamic>>? ingredientsToJson(
List<Ingredient>? ingredients) {
if (ingredients == null || ingredients.isEmpty) {
return null;
}
List<Map<String, dynamic>> result = [];
for (Ingredient ingredient in ingredients) {
result.add(ingredient.toJson());
}
return result;
}