pubPackage property

String? get pubPackage

(only valid if isPubRef) gets the package name from the pub ref

Implementation

String? get pubPackage {
  if (!isPubRef) {
    return null;
  }
  final uri = Uri.parse(ref);
  return uri.host;
}