fromJson static method

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

Implementation

@visibleForTesting
static OnlineProcessingConfig? fromJson(jsonObject) {
  if (jsonObject == null) return null;
  OnlineMode mode = OnlineMode.getByValue(jsonObject["mode"])!;
  var result = OnlineProcessingConfig(mode);

  result.url = jsonObject["url"];
  result.imageFormat = ImageFormat.getByValue(jsonObject["imageFormat"])!;
  result.imageCompressionQuality =
      jsonObject["imageCompressionQuality"].toDouble();
  result.processParams = ProcessParams.fromJson(jsonObject["processParams"]);

  return result;
}