fromJson static method

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

Implementation

@visibleForTesting
static ScannerConfig? fromJson(jsonObject) {
  if (jsonObject == null) return null;

  var result = ScannerConfig._empty();

  result._scenario = Scenario.getByValue(jsonObject["scenario"]);
  result._onlineProcessingConfig =
      OnlineProcessingConfig.fromJson(jsonObject["onlineProcessingConfig"]);
  result.livePortrait = _bytesFromBase64(jsonObject["livePortrait"]);
  result.extPortrait = _bytesFromBase64(jsonObject["extPortrait"]);
  result.cameraId = jsonObject["cameraId"];

  return result;
}