CINXE.COM
Package scores & pub points | Help | Dart packages
<!DOCTYPE html> <html lang="en-us"><head><script src="https://www.googletagmanager.com/gtm.js?id=GTM-MX6DBN9" async="async"></script><script src="/static/hash-pb35dgsm/js/gtm.js" async="async"></script><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@dart_lang"/><meta name="twitter:description" content="Pub is the package manager for the Dart programming language, containing reusable libraries & packages for Flutter and general Dart programs."/><meta name="twitter:image" content="https://pub.dev/static/hash-pb35dgsm/img/pub-dev-icon-cover-image.png"/><meta property="og:type" content="website"/><meta property="og:site_name" content="Dart packages"/><meta property="og:title" content="Package scores & pub points | Help | Dart packages"/><meta property="og:description" content="Pub is the package manager for the Dart programming language, containing reusable libraries & packages for Flutter and general Dart programs."/><meta property="og:image" content="https://pub.dev/static/hash-pb35dgsm/img/pub-dev-icon-cover-image.png"/><meta property="og:url" content="https://pub.dev/help/scoring"/><title>Package scores & pub points | Help | Dart packages</title><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Google+Sans+Display:wght@400&family=Google+Sans+Text:wght@400;500;700&family=Google+Sans+Mono:wght@400;700&display=swap"/><link rel="shortcut icon" href="/favicon.ico?hash=nk4nss8c7444fg0chird9erqef2vkhb8"/><meta rel="apple-touch-icon" href="/static/hash-pb35dgsm/img/apple-touch-icon.png"/><meta rel="apple-touch-icon-precomposed" href="/static/hash-pb35dgsm/img/apple-touch-icon.png"/><link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/><link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/><link rel="canonical" href="https://pub.dev/help/scoring"/><meta name="description" content="Pub is the package manager for the Dart programming language, containing reusable libraries & packages for Flutter and general Dart programs."/><link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/><link rel="stylesheet" type="text/css" href="/static/hash-pb35dgsm/material/bundle/styles.css"/><link rel="stylesheet" type="text/css" href="/static/hash-pb35dgsm/css/style.css"/><script src="/static/hash-pb35dgsm/material/bundle/script.min.js" defer="defer"></script><script src="/static/hash-pb35dgsm/js/script.dart.js" defer="defer"></script><script src="https://www.gstatic.com/brandstudio/kato/cookie_choice_component/cookie_consent_bar.v3.js" defer="defer" data-autoload-cookie-consent-bar="true"></script></head><body class="page-standalone light-theme"><script src="/static/hash-pb35dgsm/js/dark-init.js"></script><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MX6DBN9" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><div class="site-header"><button class="hamburger" aria-label="menu toggle"></button><a class="logo" href="/" aria-label="Go to the landing page of pub.dev"><img class="site-logo" src="/static/hash-pb35dgsm/img/pub-dev-logo.svg" alt="" width="140" height="30" role="presentation"/></a><div class="site-header-space"></div><div class="site-header-mask"></div><div class="site-header-search"><form action="/packages" method="GET"><input class="site-header-search-input" name="q" placeholder="New search..." autocomplete="on" title="Search"/></form></div><nav class="site-header-nav scroll-container"><div class="nav-login-container"><button id="-account-login" class="nav-main-button link">Sign in</button></div><div class="nav-container nav-help-container hoverable"><button class="nav-main-button">Help</button><div class="nav-hover-popup"><div class="nav-table-columns"><div class="nav-table-column"><h3>pub.dev</h3><a class="nav-link" href="/help/search" rel="noopener" target="_blank">Searching for packages</a><a class="nav-link" href="/help/scoring" rel="noopener" target="_blank">Package scoring and pub points</a></div><div class="nav-table-column"><h3>Flutter</h3><a class="nav-link" href="https://flutter.dev/using-packages/" rel="noopener" target="_blank">Using packages</a><a class="nav-link" href="https://flutter.dev/developing-packages/" rel="noopener" target="_blank">Developing packages and plugins</a><a class="nav-link" href="https://dart.dev/tools/pub/publishing" rel="noopener" target="_blank">Publishing a package</a></div><div class="nav-table-column"><h3>Dart</h3><a class="nav-link" href="https://dart.dev/guides/packages" rel="noopener" target="_blank">Using packages</a><a class="nav-link" href="https://dart.dev/tools/pub/publishing" rel="noopener" target="_blank">Publishing a package</a></div></div></div></div><div class="nav-container nav-help-container-mobile foldable"><h3 class="foldable-button">pub.dev <img class="foldable-icon" src="/static/hash-pb35dgsm/img/nav-mobile-foldable-icon.svg" alt="toggle folding of the section" width="13" height="6"/></h3><div class="foldable-content"><a class="nav-link" href="/help/search" rel="noopener" target="_blank">Searching for packages</a><a class="nav-link" href="/help/scoring" rel="noopener" target="_blank">Package scoring and pub points</a></div></div><div class="nav-container nav-help-container-mobile foldable"><h3 class="foldable-button">Flutter <img class="foldable-icon" src="/static/hash-pb35dgsm/img/nav-mobile-foldable-icon.svg" alt="toggle folding of the section" width="13" height="6"/></h3><div class="foldable-content"><a class="nav-link" href="https://flutter.dev/using-packages/" rel="noopener" target="_blank">Using packages</a><a class="nav-link" href="https://flutter.dev/developing-packages/" rel="noopener" target="_blank">Developing packages and plugins</a><a class="nav-link" href="https://dart.dev/tools/pub/publishing" rel="noopener" target="_blank">Publishing a package</a></div></div><div class="nav-container nav-help-container-mobile foldable"><h3 class="foldable-button">Dart <img class="foldable-icon" src="/static/hash-pb35dgsm/img/nav-mobile-foldable-icon.svg" alt="toggle folding of the section" width="13" height="6"/></h3><div class="foldable-content"><a class="nav-link" href="https://dart.dev/guides/packages" rel="noopener" target="_blank">Using packages</a><a class="nav-link" href="https://dart.dev/tools/pub/publishing" rel="noopener" target="_blank">Publishing a package</a></div></div></nav><button class="-pub-theme-toggle" aria-label="light/dark theme toggle"></button></div><div id="banner-container"></div><main class="container"><div class="standalone-wrapper -has-side-image"><div class="standalone-side-image-block"><img class="standalone-side-image" src="/static/hash-pb35dgsm/img/packages-side.webp" alt="" width="400" height="400" role="presentation"/></div><div class="standalone-content"><h1 id="package-scores--pub-points" class="hash-header">Package scores & pub points <a href="#package-scores--pub-points" class="hash-link">#</a></h1> <p><em>NOTE: The Pub scoring model evolves over time, and is likely to be extended with additional checks in the future.</em></p> <p>For each package, this site displays three scoring dimensions. These are displayed in search results, in the sidebar on individual package pages, and in full detail in the scoring report on the 'Scores' tag of an individual package. The three dimensions are:</p> <ul> <li><strong>Likes</strong>: A measure of how many developers have liked a package. This provides a raw measure of the overall sentiment of a package from peer developers.</li> <li><strong>Pub Points</strong>: A new measure of quality. This includes several dimensions of quality such as code style, platform support, and maintainability. More about this below.</li> <li><strong>Popularity</strong>: A measure of how many developers use a package, providing insight into what other developers are using.</li> </ul> <h2 id="likes" class="hash-header">Likes <a href="#likes" class="hash-link">#</a></h2> <p>Likes offer a measure of how many developers have liked a package. To like a package, locate the <strong>thumbs up button</strong> located in the upper-right corner of a package page.</p> <p>To view packages you have liked, use the <strong>My pub.dev > My liked packages</strong> menu option.</p> <h2 id="download-counts" class="hash-header">Download counts <a href="#download-counts" class="hash-link">#</a></h2> <p>Pub.dev tracks and stores how many times each version of each package gets downloaded. This is used to display package usage metrics.</p> <p>The displayed download counts on pub.dev are aggregates based on raw server-side numbers counting the times a package archive has been downloaded from the server.</p> <p>The download count is not a direct measure of how many users a package has. A package can have a high usage with relatively low download counts, because the pub client caches the downloads in the <code>PUB_CACHE</code>. This is a shared cache, so a particular package version will only be downloaded once per user on a particular developer machine, even if the user invokes <code>pub get</code> many times across different projects.</p> <p>On the other hand, for some packages the download count may be relatively high. For instance, the number can be high if the package is used as a dependency by other popular packages. The download counts can also be highly affected if the package is used by CI systems running tests, since these systems typically don't retain the <code>PUB_CACHE</code> between test runs.</p> <p>The download count is not a perfect metric, and should only be regarded as an indicator of popularity.</p> <h2 id="popularity" class="hash-header">Popularity <a href="#popularity" class="hash-link">#</a></h2> <p>Popularity measures the number of apps that depend on a package over the past 60 days. We show this as a percentile from 100% (among the top 1% most used packages) to 0% (the least used package). We are investigating if we can provide absolute usage counts in a future version See <a href="https://github.com/dart-lang/pub-dev/issues/2714" rel="ugc">this</a> issue.</p> <p>Although this score is based on actual download counts, it compensates for automated tools such as continuous builds that fetch the package on each change request.</p> <h2 id="pub-points" class="hash-header">Pub Points <a href="#pub-points" class="hash-link">#</a></h2> <p>Pub points is pub.dev's measure of quality. Pub points are awarded in six categories:</p> <h3 id="follow-dart-file-conventions" class="hash-header">Follow Dart file conventions <a href="#follow-dart-file-conventions" class="hash-link">#</a></h3> <p>Dart packages are expected to follow certain file conventions for how to <a href="https://dart.dev/guides/libraries/create-library-packages#organizing-a-library-package">organize a package</a>. Most importantly make sure to:</p> <ul> <li> <p>Provide a <a href="https://dart.dev/tools/pub/pubspec"><code>pubspec.yaml</code> file</a>. Ensure all Urls are valid and use a secure <code>https:</code> scheme.</p> </li> <li> <p>Provide a <a href="https://dart.dev/tools/pub/package-layout#license"><code>LICENSE</code></a> file, preferably using an an <a href="https://opensource.org/licenses" rel="ugc">OSI-approved license</a>.</p> </li> <li> <p>Provide a <a href="https://dart.dev/tools/pub/package-layout#readmemd"><code>README.md file</code></a> describing the changes in each version of the package.</p> </li> <li> <p>Provide a <a href="https://dart.dev/tools/pub/package-layout#changelogmd"><code>CHANGELOG.md file</code></a> describing the changes in each version of the package. Make sure to follow <a href="https://dart.dev/tools/pub/package-layout#changelogmd">the guidelines</a> for how to format headings and versions so that these can be rendered correctly on pub.dev.</p> </li> </ul> <h3 id="provide-documentation" class="hash-header">Provide documentation <a href="#provide-documentation" class="hash-link">#</a></h3> <p>This category measures if a package has documentation in two areas:</p> <ul> <li> <p>The package has an illustrative code example. See the <a href="https://dart.dev/tools/pub/package-layout#examples">layout documentation</a> for details about where to place this example.</p> </li> <li> <p>At least 20% of the public API members contain <a href="https://dart.dev/guides/libraries/create-library-packages#documenting-a-library">API documentation</a>.</p> </li> </ul> <h3 id="platform-support" class="hash-header">Platform support <a href="#platform-support" class="hash-link">#</a></h3> <p>Packages are encouraged to support multiple platforms, to enable app developers to support a wide variety of platforms for their apps. This includes Dart's <a href="https://dart.dev/platforms">native and web</a> platforms, and Flutter's <a href="https://flutter.dev/docs">mobile</a>, <a href="https://flutter.dev/web">web</a>, and <a href="https://flutter.dev/desktop">desktop</a> targets.</p> <p>pub.dev knows about the following platforms:</p> <ul> <li>Windows</li> <li>Linux</li> <li>macOS</li> <li>Android</li> <li>iOS</li> <li>Web</li> </ul> <p>And the two SDKs:</p> <ul> <li>Flutter</li> <li>Dart</li> </ul> <p>The platform support will be detected by analyzing the transitive import graph of the top-level libraries, and finding what core libraries are used. (e.g. a package importing <code>dart:html</code> does not support the 'windows' platform).</p> <p>If you need to import different libraries for specific platforms (e.g. on the web vs on devices), you can use Dart's <a href="https://dart.dev/guides/libraries/create-library-packages#conditionally-importing-and-exporting-library-files"><strong>conditional imports</strong></a>.</p> <h4 id="declaring-platforms">Declaring platforms:</h4> <p>For packages that make sense or only have implementation on a subset of platforms the detected platform support can be overridden with a platform declaration in the <code>pubspec.yaml</code> file:</p> <ul> <li> <p>Flutter plugins declare their platforms by the <a href="https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms"><code>flutter.plugin.platform</code> key</a>.</p> </li> <li> <p>Packages using FFI or otherwise being platform-specific can declare their platform support using a top-level [<code>platforms</code>] declaration:</p> <pre><code class="language-yaml"># This package works only on Windows and Linux. platforms: windows: linux: </code></pre> </li> </ul> <h3 id="pass-static-analysis" class="hash-header">Pass static analysis <a href="#pass-static-analysis" class="hash-link">#</a></h3> <p>Static analysis is used to determine of the package contains any errors, warnings, and lints (code style issues).</p> <p>To validate a package prior to publishing, run <code>dart analyze</code> (Dart SDK) / <code>flutter analyze</code> (Flutter SDK), and fix the items it returns.</p> <p>For code style, make sure to familiarize yourself with the <a href="https://dart.dev/guides/language/effective-dart/style">Dart style guide</a>.</p> <p>Your package will be analyzed against the lints in the standard <a href="https://pub.dev/packages/lints">lints</a> package. Look <a href="https://pub.dev/packages/lints#how-to-enable-these-lints">here</a> to learn how to enable the same lints locally.</p> <h3 id="support-up-to-date-dependencies" class="hash-header">Support up-to-date dependencies <a href="#support-up-to-date-dependencies" class="hash-link">#</a></h3> <p>This category measures if a package has up-to-date dependencies in three areas:</p> <ul> <li>Works with the latest stable Dart SDK.</li> <li>Works with the latest stable Flutter SDK (if applicable).</li> <li>Works with the latest versions of all dependencies.</li> </ul> <p>To determine if your package supports the latest versions of dependencies prior to publishing, run the <code>pub outdated</code> command (Dart SDK) or <code>flutter pub outdated</code> command (Flutter SDK).</p> <h2 id="calculating-pub-points-prior-to-publishing" class="hash-header">Calculating pub points prior to publishing <a href="#calculating-pub-points-prior-to-publishing" class="hash-link">#</a></h2> <p>The pub.dev site uses the analysis tool <a href="https://pub.dev/packages/pana">pana</a> to calculate pub points. This is run automatically on the pub.dev site whenever you publish a new package, or a new version of an existing package.</p> <p>You can view your <em>pub points report</em> to get suggestions before publishing, by running <code>pana</code> locally:</p> <ol> <li> <p>When run <code>pana</code> will make modifications to the package, so start by making a copy of the directory holding your package: <code>cp ~/dev/mypkg ~/tmp/mypkg</code></p> </li> <li> <p>Make sure you have the latest pana tool: <code>dart pub global activate pana</code> (<code>pana</code> changes frequently, so run this again frequently to update the pana tool)</p> </li> <li> <p>Run pana on the copy we made earlier: <code>dart pub global run pana ~/tmp/mypkg</code></p> </li> </ol> </div></div></main><footer class="site-footer"><a class="link" href="https://dart.dev/">Dart language</a><a class="link sep" href="/policy">Policy</a><a class="link sep" href="https://www.google.com/intl/en/policies/terms/">Terms</a><a class="link sep" href="https://developers.google.com/terms/">API Terms</a><a class="link sep" href="/security">Security</a><a class="link sep" href="https://www.google.com/intl/en/policies/privacy/">Privacy</a><a class="link sep" href="/help">Help</a><a class="link icon sep" href="/feed.atom"><img class="inline-icon" src="/static/hash-pb35dgsm/img/rss-feed-icon.svg" alt="RSS" width="20" height="20" title="RSS/atom feed"/></a><a class="link icon github_issue" href="https://github.com/dart-lang/pub-dev/issues/new"><img class="inline-icon" src="/static/hash-pb35dgsm/img/bug-report-white-96px.png" alt="bug report" width="20" height="20" title="Report an issue with this site"/></a></footer></body></html>