fromJson static method

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

Implementation

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

  result._first = ComparedFace.fromJson(jsonObject["first"])!;
  result._second = ComparedFace.fromJson(jsonObject["second"])!;
  result._similarity = _toDouble(jsonObject["similarity"])!;
  result._score = _toDouble(jsonObject["score"])!;
  result._error = MatchFacesException.fromJson(jsonObject["error"]);

  return result;
}