fromJson static method

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

Implementation

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

  result._detection = DetectFaceResult.fromJson(jsonObject["detection"]);
  if (jsonObject["allDetections"] != null) {
    result._allDetections = [];
    for (var item in jsonObject["allDetections"]) {
      result._allDetections!.add(DetectFaceResult.fromJson(item)!);
    }
  }
  result._scenario = DetectFacesScenario.getByValue(jsonObject["scenario"]);
  result._error = DetectFacesException.fromJson(jsonObject["error"]);

  return result;
}