PluginPrintParams.fromJson constructor

PluginPrintParams.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json, {
  4. ClientUriConverter? clientUriConverter,
})

Implementation

factory PluginPrintParams.fromJson(
  JsonDecoder jsonDecoder,
  String jsonPath,
  Object? json, {
  ClientUriConverter? clientUriConverter,
}) {
  json ??= {};
  if (json is! Map) {
    throw jsonDecoder.mismatch(jsonPath, "'plugin.print params'", json);
  }
  PluginPrint pluginPrint;
  if (json case {'pluginPrint': var encodedPluginPrint}) {
    pluginPrint = PluginPrint.fromJson(
      jsonDecoder,
      '$jsonPath.pluginPrint',
      encodedPluginPrint,
      clientUriConverter: clientUriConverter,
    );
  } else {
    throw jsonDecoder.mismatch(jsonPath, "'pluginPrint'", json);
  }
  return PluginPrintParams(pluginPrint);
}