resolve method

  1. @override
Future<ResolvedSource?> resolve(
  1. SourceResolutionContext context
)
override

Try to resolve the source specification.

Returns a ResolvedSource if this provider can handle the specification, or null to skip to the next provider.

Implementation

@override
Future<ResolvedSource?> resolve(SourceResolutionContext context) async {
  final spec = context.specification;
  if (spec is! LocalSource) return null;

  final directory = spec.resolve(context.packageRoot);
  if (directory == null) return null;

  return ResolvedSource(directory: directory, origin: SourceOrigin.local);
}