SearchFindMemberDeclarationsParams.fromJson constructor

SearchFindMemberDeclarationsParams.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json
)

Implementation

factory SearchFindMemberDeclarationsParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    String name;
    if (json.containsKey('name')) {
      name = jsonDecoder.decodeString('$jsonPath.name', json['name']);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'name');
    }
    return SearchFindMemberDeclarationsParams(name);
  } else {
    throw jsonDecoder.mismatch(
        jsonPath, 'search.findMemberDeclarations params', json);
  }
}