WorkspaceTarget.fromMap constructor
Implementation
factory WorkspaceTarget.fromMap(String id, Map<Object?, Object?> value) {
final rawPackages = value['packages'];
if (rawPackages is! List) {
throw FormatException('target $id requires packages');
}
return WorkspaceTarget(
id: id,
language: _requiredString(value, 'language'),
framework: _requiredString(value, 'framework'),
packages: [
for (final raw in rawPackages)
if (raw is Map)
WorkspacePackage.fromMap(Map<Object?, Object?>.from(raw))
else
throw FormatException('target $id package must be a mapping'),
],
);
}