deserializeJson function

dynamic deserializeJson(
  1. String s, {
  2. Type? outputType,
})

Deserializes JSON into data, without validating it.

Implementation

deserializeJson(String s, {Type? outputType}) {
  logger.info("Deserializing the following JSON: $s");

  if (outputType == null) {
    logger
        .info("No output type was specified, so we are just using json.decode");
    return json.decode(s);
  } else {
    logger.info("Now deserializing to type: $outputType");
    return deserializeDatum(json.decode(s), outputType: outputType);
  }
}