packageMetrics method

Future<PackageMetrics?> packageMetrics(
  1. String packageName
)

Returns the PackageMetrics for package packageName

Implementation

Future<PackageMetrics?> packageMetrics(String packageName) async {
  try {
    final data = await _fetch(endpoint.packageMetrics(packageName));
    return PackageMetrics.fromMap(data);
  } on NotFoundException {
    // If the package has not been scanned, the server will return 404
    return null;
  }
}