EditFormatIfEnabledParams.fromJson constructor

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

Implementation

factory EditFormatIfEnabledParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    List<String> directories;
    if (json.containsKey('directories')) {
      directories = jsonDecoder.decodeList('$jsonPath.directories',
          json['directories'], jsonDecoder.decodeString);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'directories');
    }
    return EditFormatIfEnabledParams(directories);
  } else {
    throw jsonDecoder.mismatch(jsonPath, 'edit.formatIfEnabled params', json);
  }
}