fromJson static method

  1. @visibleForTesting
MatchFacesDetectionFace? fromJson(
  1. dynamic jsonObject
)

Implementation

@visibleForTesting
static MatchFacesDetectionFace? fromJson(jsonObject) {
  if (jsonObject == null) return null;
  var result = MatchFacesDetectionFace._privateConstructor();

  List<Point> landmarks = [];
  for (var item in jsonObject["landmarks"]) {
    landmarks.add(Point.fromJson(item)!);
  }

  result._faceIndex = jsonObject["faceIndex"];
  result._landmarks = landmarks;
  result._faceRect = Rect.fromJson(jsonObject["faceRect"])!;
  result._rotationAngle = _toDouble(jsonObject["rotationAngle"]);
  result._originalRect = Rect.fromJson(jsonObject["originalRect"]);
  result._crop = _bytesFromBase64(jsonObject["crop"]);

  return result;
}