toJson method

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

Implementation

@override
Map<String, dynamic> toJson() {
  Map<String, dynamic> jsonObject = {};
  jsonObject['id'] = id;
  if (name != null) jsonObject['name'] = name;
  if (purpose != null) jsonObject['purpose'] = purpose;
  if (format != null) jsonObject['format'] = format!.toJson();
  if (constraints != null) jsonObject['constraints'] = constraints!.toJson();
  if (group != null) jsonObject['group'] = group;
  return jsonObject;
}