toJson method

Map toJson()

Implementation

Map toJson() {
  Map _result = {};

  if (detection != null) _result.addAll({"detection": detection!.toJson()});
  if (!images.isEmpty) {
    var list = [];
    for (var item in images) list.add(item!.toJson());
    _result.addAll({"images": list});
  }
  if (name != null) _result.addAll({"name": name});
  _result.addAll({"groups": groups});
  if (updatedAt != null) _result.addAll({"updatedAt": updatedAt});
  if (id != null) _result.addAll({"id": id});
  if (metadata != null) _result.addAll({"metadata": metadata});
  if (createdAt != null) _result.addAll({"createdAt": createdAt});

  return _result;
}