toJson method

  1. @override
Map<String, dynamic> toJson()
override

Serialize this recipe to JSON.

Implementation

@override
Map<String, dynamic> toJson() => {
  'type': 'step_build_recipe',
  'steps': steps.map((step) => step.toJson()).toList(),
  if (needsById.isNotEmpty) 'needs_by_id': needsById,
};