pana 0.10.6

  • Installing
  • Versions
  • 79

Build Status

A library for analyzing Dart packages.

  • Validates the code using Dart Analyzer.
  • Checks code formatting.
  • Checks for outdated dependencies.
  • Infers supported platforms: Flutter, web, and/or server.

Used by the Dart Package site.

Use as an executable


> pub global activate pana


You can specify either a package (+ version) or a local directory to analyze:

Usage: pana [<options>] <package> [<version>]
       pana [<options>] --source path <directory>

  -j, --json            Output log items as JSON.
  -s, --source          The source used to find the package.
                        [hosted (default), path]
      --hosted-url      The server that hosts <package>.
                        (defaults to "")
      --[no-]warning    Shows the warning message before potentially destructive operation.
                        (defaults to on)


  • Enable Dart 2 Preview in analyzer options (including non-Flutter packages).

  • Change platform classification of dart:isolate: no longer available on web.

  • Treat environment: keys as dependent SDKs (e.g. flutter).

  • Use LibraryElement.hasExtUri to detect dart-ext: imports.

  • Detailed suggestion messages when package has conflicting platforms.


  • Enable Dart 2 Preview in Flutter analyzer options.


  • Fix CI test

  • Flutter-specific suggestion messages for dartfmt and dartanalyzer.


  • Fix end-to-end test (package dependency changed).

  • Move pubspec stripping inside PubEnvironment.runUpgrade (dartdoc service will get it for free).

  • Handle more repository URLs (e.g.

  • Expose Flutter detection to clients, with better naming (isFlutter -> usesFlutter).


  • Fix issue of not using the PUB_CACHE directory when it was set.

  • Update analyzer to 0.31 and extends quiver version range.

  • Fix issue where we were not passing the proper package directory variable.

  • Expose all dartanalyzer and dartfmt problems as suggestions.


  • Include component list in platform classification reasons.

  • Do not report on unconstrained SDK dependencies.

  • New platform component: build.

  • Remove dependency_overrides from pubspec.yaml.



  • Removed DartPlatform.description and DartPlatform.descriptionAndReason because we don't use them elsewhere and complicates the PlatformNames with everywhere and undefined.

  • Removed PlatformNames.everywhere and PlatformNames.undefined, because we don't print these anywhere except in tests.

  • Removed PlatformNames.dartExtension, because we use it only internally.

  • Removed DartPlatform.restrictedTo, using the fields components and uses instead.

  • Removed PlatformNames.server (and its platform detection), using a wider other platform instead.


  • Use raw links for images in repository URLs.

  • Move unconstrained version penalty from health score to maintenance.

  • Move platform conflict penalty from health score to maintenance.

  • Sort maintenance suggestions in decreasing importance.


  • Fix NPE when dependency has no constraint (e.g. git repo).


  • Only direct unconstrained dependencies decrease the health score.

  • Removed superfluous pubspec.lock validation.

  • Recommend descriptions between 60 and 180 characters.

  • Detect another license format

  • Pass-through values of analyzer_options.yaml errors like uri_has_not_been_generated.


  • Unblock platform classification on a new class of errors.

  • Better messages in platform classification.


  • Use Flutter-recommended analysis options when analyzer Flutter packages.

  • BREAKING BEHAVIOR: Don't use PUB_HOSTED_URL for package downloads, as it has not worked out in practice. Instead, we've added a --hosted-url command line argument.


  • PackageAnalyzer.inspectPackage added a named argument deleteTemporaryDirectory. Setting this to false retains the directory and prints its location to the log. Useful for debugging.

  • Maintenance

    • BREAKING getMaintenanceScore now takes an optional age parameter replacing the previously required publishDate parameter.

    • Changed the meaning of version fields:

      • isExperimentalVersion now means pre-V1.
      • isPreReleaseVersion now means there is a pre-release flag like -beta, -alpha, etc.
    • BREAKING maintenance-related Suggestion entries as moved to Maintenance.suggestions

  • BREAKING Suggestion.file is now String instead of dynamic.

  • Detect the new format of native extensions.

  • Unblock platform classification on a new class of errors.

  • Use PUB_HOSTED_URL for package downloads.


  • Allow more versions of package:args.


  • Added pana as an executable. Enables pub global activate pana.

  • Improved license detection: commented license files are now recognized.


  • Handle more critical exceptions and report them with more details.

  • The Suggestion.bug constructor had a breaking change – a required argument was added, but this is not intended for invocation by end-users.


  • Add SuggestionLevel.bug and use it to record fatal errors with the tool.


  • Fixed issue where analyzer and/or formatter were run on directories with no Dart files.


  • Breaking changes

    • Summary.sdkVersion is now a Version instead of String.

    • new PackageAnalyzer(...) now takes a DartSdk instance instead of a String.

  • static Future<PackageAnalyzer> create(...) was added to PackageAnalyzer.

  • Added logger optional argument to PackageAnalyzer.inspectPackage.


  • Allow platform classification for a small class of analysis errors.


  • Don't count the absence of an analysis_options.yaml file against a package.


  • Breaking changes

    • Removed ToolProblem class.
    • Removed Summary.toolProblems, in favor of Summary.suggestions.
  • Detect and store maintenance-related data in summary.

    • Scoring of tool problems moved from Fitness to Maintenance.
  • Provide human-readable feedback and instructions on some of the issues we find during the analysis.


  • Use a consistent 2 minute timeout for all processes.

  • Classify platform as nowhere when part of analysis fails.


  • Breaking changes

    • License renamed to LicenseFile
    • Summary.license -> licenses: we'll return multiple licenses
    • Removed LicenseNames.missing: empty List will indicate no license file
  • Greatly expanded and improved license detection.


  • Breaking changes

    • Renamed AnalyzerIssue -> ToolProblem

      • Renamed Summary.issues -> toolProblems
      • Renamed AnalyzerIssue.scope -> tool
      • Renamed AnalyzerScopes -> ToolNames
    • Renamed AnalyzerOutput -> CodeProblem

      • Renamed Summary.analyzerItems and DartFileSummary.analyzerItems -> codeProblems
    • Refactored CodeProblem (previously AnalyzerOutput):

      • Split up type, new fields: severity, errorType, errorCode
      • Renamed error to description
    • Refactored Fitness:

      • Renamed total -> magnitude
      • Removed value, using shortcoming instead (value = magnitude - shortcoming;)
    • Refactored PubSummary, renamed to PkgResolution

      • Moved pubspec -> Summary
      • Moved pkgVersion -> Pubspec.version
      • Moved authors -> Pubspec.authors
      • Merged packageVersions and availableVersions into dependencies
      • Renamed Summary.pubSummary -> pkgResolution
    • Refactored platform:

      • Renamed PlatformFlags -> PlatformNames
      • Removed most of the platform-related classes, using DartPlatform instead


  • Removed PlatformSummary.package in favor of PlatformSummary.pubspec of (new) type PubspecPlatform.

  • Renamed KnownPlatforms to PlatformFlags. Also:

    • Removed mirrors, browser and standalone.
    • Renamed native to dartExtension.
  • PlatformInfo

    • Now store dart:* references directly in uses.
    • worksInStandalone renamed to worksOnServer.
    • Other .worksIn* renamed to worksOn*.
    • Added String get description which returns a simple String description of the supported platforms. Examples: everywhere, flutter, server, web, conflict.
    • Removed angular as a value in uses.


  • Detect native extensions.

  • Detect licenses.


  • Lot's of stability improvements.

  • Improvements to error handling.


  • Lot's of cleanup to JSON output.

  • Improved stability.

  • Platform detection basics.


  • Added support for flutter packages.

  • Expanded analysis to include transitive dependencies.

  • Added scoring library.

  • Moved the repo to dart-lang.


  • A lot of tweaks. Still under heavy development.


  • Initial version.

1. Depend on it

Add this to your package's pubspec.yaml file:

  pana: "^0.10.6"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:pana/pana.dart';
Version Uploaded Documentation Archive
0.10.6 Apr 6, 2018 Go to the documentation of pana 0.10.6 Download pana 0.10.6 archive
0.10.5 Mar 23, 2018 Go to the documentation of pana 0.10.5 Download pana 0.10.5 archive
0.10.4 Mar 15, 2018 Go to the documentation of pana 0.10.4 Download pana 0.10.4 archive
0.10.3 Feb 28, 2018 Go to the documentation of pana 0.10.3 Download pana 0.10.3 archive
0.10.2 Feb 16, 2018 Go to the documentation of pana 0.10.2 Download pana 0.10.2 archive
0.10.1 Feb 2, 2018 Go to the documentation of pana 0.10.1 Download pana 0.10.1 archive
0.10.0 Jan 19, 2018 Go to the documentation of pana 0.10.0 Download pana 0.10.0 archive
0.9.1 Jan 17, 2018 Go to the documentation of pana 0.9.1 Download pana 0.9.1 archive
0.9.0+1 Jan 10, 2018 Go to the documentation of pana 0.9.0+1 Download pana 0.9.0+1 archive
0.9.0 Jan 10, 2018 Go to the documentation of pana 0.9.0 Download pana 0.9.0 archive

All 33 versions...


We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6


Describes how popular the package is relative to other packages. [more]
61 / 100
Code health derived from static analysis. [more]
97 / 100
Reflects how tidy and up-to-date the package is. [more]
99 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, other

Primary library: package:pana/pana.dart with components: io, isolate.


  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 errors.

    Strong-mode analysis of lib/src/platform.dart failed with the following error:

    line: 205 col: 12
    The function expression type '(PlatformDef) → String' isn't of type '(dynamic) → String'. This means its parameter or return type does not match what is expected. Consider changing parameter type(s) or the returned type(s).

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use pana.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.2 <2.0.0
analyzer ^0.31.0 0.31.1 0.31.2-alpha.1
args >=0.13.7 <2.0.0 1.4.2
async >=1.13.3 <3.0.0 2.0.6
cli_util ^0.1.1 0.1.2+1
http >=0.11.3 <0.12.0 0.11.3+16
io ^0.3.0 0.3.2+1
json_annotation ^0.2.2 0.2.3
logging ^0.11.3+1 0.11.3+1
meta ^1.1.2 1.1.2
path ^1.4.1 1.5.1
pub_semver ^1.3.2 1.3.7
quiver >=0.24.0 <0.29.0 0.28.2 0.29.0+1
yaml ^2.1.12 2.1.13
Transitive dependencies
charcode 1.1.1
collection 1.14.9
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
front_end 0.1.0-alpha.9 0.1.0-alpha.11
glob 1.1.5
html 0.13.3
http_parser 3.1.1
isolate 1.1.0 2.0.0
kernel 0.3.0-alpha.9 0.3.0-alpha.11
matcher 0.12.2
package_config 1.0.3
plugin 0.2.0+2
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
Dev dependencies
build >=0.11.0 <0.13.0
build_config ^0.2.1
build_runner ^0.8.0
json_serializable ^0.5.0
source_gen ^0.8.0
test ^0.12.0
test_descriptor ^1.0.3
test_process ^1.0.1