DartVersionOptions.resolve constructor
DartVersionOptions.resolve(
- Object? sourceParamAny, {
- bool allowPubName = true,
})
Implementation
factory DartVersionOptions.resolve(
Object? sourceParamAny, {
bool allowPubName = true,
}) {
String? sourceParam = sourceParamAny?.toString();
var targetPubspec = resolvePubspec(sourceParam);
if (!targetPubspec.existsSync()) {
if (sourceParam != null && !sourceParam.contains(separator)) {
// Treat as a pub.flutter-io.cn
return DartVersionOptions.forPackage(sourceParam);
} else {
throw ArgumentError(
'The source file ${targetPubspec.absolute.path} does not exist',
'source');
}
} else {
return DartVersionOptions(source: targetPubspec.absolute.path);
}
}