ExtractLocalVariableOptions.fromJson constructor
ExtractLocalVariableOptions.fromJson(})
Implementation
factory ExtractLocalVariableOptions.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is! Map) {
throw jsonDecoder.mismatch(
jsonPath,
"'extractLocalVariable options'",
json,
);
}
String name;
if (json case {'name': var encodedName}) {
name = jsonDecoder.decodeString('$jsonPath.name', encodedName);
} else {
throw jsonDecoder.mismatch(jsonPath, "'name'", json);
}
bool extractAll;
if (json case {'extractAll': var encodedExtractAll}) {
extractAll = jsonDecoder.decodeBool(
'$jsonPath.extractAll',
encodedExtractAll,
);
} else {
throw jsonDecoder.mismatch(jsonPath, "'extractAll'", json);
}
return ExtractLocalVariableOptions(name, extractAll);
}