LibraryPathSet.fromJson constructor
LibraryPathSet.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- Object? json
)
Implementation
factory LibraryPathSet.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String scope;
if (json.containsKey('scope')) {
scope = jsonDecoder.decodeString('$jsonPath.scope', json['scope']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'scope');
}
List<String> libraryPaths;
if (json.containsKey('libraryPaths')) {
libraryPaths = jsonDecoder.decodeList('$jsonPath.libraryPaths',
json['libraryPaths'], jsonDecoder.decodeString);
} else {
throw jsonDecoder.mismatch(jsonPath, 'libraryPaths');
}
return LibraryPathSet(scope, libraryPaths);
} else {
throw jsonDecoder.mismatch(jsonPath, 'LibraryPathSet', json);
}
}