toJson method

Map toJson()

Implementation

Map toJson(){
  Map _result = {};

  if (faceIndex != null) _result.addAll({"faceIndex": faceIndex});
  if (!landmarks.isEmpty) {
    var list = [];
    for (var item in landmarks) list.add(item!.toJson());
    _result.addAll({"landmarks": list});
  }
  if (faceRect != null) _result.addAll({"faceRect": faceRect!.toJson()});
  if (rotationAngle != null) _result.addAll({"rotationAngle": rotationAngle});
  if (thumbnail != null) _result.addAll({"thumbnail": thumbnail});

  return _result;
}