pub_cache 0.2.2

  • Installing
  • Versions
  • 76


A library to reflect on the local pub cache.

pub package Build Status Build status

How do I use it?

pub_cache lets you reflect on the information in your Pub cache. For example, to find all the applications that have been activated:

PubCache cache = new PubCache();

for (Application app in cache.getGlobalApplications()) {
  print('activated app: ${}, version: ${app.version}');

Some other interesting use cases:

  • finding all the activated applications whose defining package has a specific meta-data file
  • given a package name, locate the directory on disk for that package, and using that location to read resources contained in the package
  • finding the latest non-dev version of all the packages in the cache

Features and bugs

Please file feature requests and bugs at the issue tracker.



  • Uses PUB_HOSTED_URL for finding hosted packages


  • Dart 2 dependency upgrades


  • upgraded to support Dart 2


  • fixed an issue with global_packages enumeration


  • release as 0.1.0


  • ensure that any missing version constraint is returned as Version.none


  • fix an issue with parsing pubspec.yaml files without a version property defined


  • initial version

Use this package as a library

1. Depend on it

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

  pub_cache: ^0.2.2

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 flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:pub_cache/pub_cache.dart';
Version Uploaded Documentation Archive
0.2.2 Sep 27, 2018 Go to the documentation of pub_cache 0.2.2 Download pub_cache 0.2.2 archive
0.2.1 Jul 22, 2018 Go to the documentation of pub_cache 0.2.1 Download pub_cache 0.2.1 archive
0.2.0 Apr 19, 2018 Go to the documentation of pub_cache 0.2.0 Download pub_cache 0.2.0 archive
0.1.1 Oct 13, 2017 Go to the documentation of pub_cache 0.1.1 Download pub_cache 0.1.1 archive
0.1.0 Jul 10, 2015 Go to the documentation of pub_cache 0.1.0 Download pub_cache 0.1.0 archive
0.0.1+2 Apr 13, 2015 Go to the documentation of pub_cache 0.0.1+2 Download pub_cache 0.0.1+2 archive
0.0.1+1 Apr 13, 2015 Go to the documentation of pub_cache 0.0.1+1 Download pub_cache 0.0.1+1 archive
0.0.1 Apr 12, 2015 Go to the documentation of pub_cache 0.0.1 Download pub_cache 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.7


Detected platforms: Flutter, other

Primary library: package:pub_cache/pub_cache.dart with components: io.

Health suggestions

Fix lib/pub_cache.dart. (-0.50 points)

Analysis of lib/pub_cache.dart reported 1 hint:

line 228 col 17: Always override hashCode if overriding ==.

Maintenance suggestions

The description is too short. (-20 points)

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

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use pub_cache.dart. Packages with multiple examples should use example/


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.17.0 <3.0.0
path ^1.0.0 1.6.2
pub_semver ^1.0.0 1.4.2
yaml ^2.0.0 2.1.15
Transitive dependencies
charcode 1.1.2
collection 1.14.11
meta 1.1.6
source_span 1.4.1
string_scanner 1.0.4
Dev dependencies
test ^1.0.0