EditFormatIfEnabledParams.fromJson constructor
EditFormatIfEnabledParams.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- 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);
}
}