EditOrganizeDirectivesResult.fromJson constructor

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

Implementation

factory EditOrganizeDirectivesResult.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    SourceFileEdit edit;
    if (json.containsKey('edit')) {
      edit = SourceFileEdit.fromJson(
          jsonDecoder, '$jsonPath.edit', json['edit']);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'edit');
    }
    return EditOrganizeDirectivesResult(edit);
  } else {
    throw jsonDecoder.mismatch(
        jsonPath, 'edit.organizeDirectives result', json);
  }
}