fromJson static method

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

Implementation

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

  if (jsonObject["attributes"] != null) {
    result.attributes = [];
    for (var item in jsonObject["attributes"]) {
      result.attributes!.add(DetectFacesAttribute.getByValue(item)!);
    }
  }
  if (jsonObject["customQuality"] != null) {
    result.customQuality = [];
    for (var item in jsonObject["customQuality"]) {
      result.customQuality!.add(ImageQualityCharacteristic.fromJson(item)!);
    }
  }
  result.outputImageParams =
      OutputImageParams.fromJson(jsonObject["outputImageParams"]);
  result.onlyCentralFace = jsonObject["onlyCentralFace"];

  return result;
}