resolver 0.1.1

  • Installing
  • Versions
  • 40



WARNING: This is not an official Google or Dart project

A very simple frontend for resolving Dart code using package:analyzer. As the API for using these mostly Dart-internal packages improves, this package will become obsolete.

Until then, it exists to help new and experienced Dart developers alike get started with tooling they want to write that requires a resolved AST (i.e. with types, imports, metadata available).

This package is not meant to be used to do source/code generation - you should look at package:source_gen or the lower-level package:build, which already has a very simplified model for resolving code.

Getting Started

This package is meant to be used along with package:analyzer, so you'll likely want to import both packages when writing a tool. So, for a quick-start example:

import 'package:analyzer/analyzer.dart';
import 'package:resolver/resolver.dart';

main() async {
  final resolver = new Resolver();
  final library = await resolver.resolveAbsoluteUri('local/file.dart');

To be able to resolve files that include package:, use forPackage:

import 'package:analyzer/analyzer.dart';
import 'package:resolver/resolver.dart';

main() async {
  final resolver = new Resolver.forPackage('local/path/package');
  final library = await resolver.resolvePackageUri(


  • Added Resolver#resolveSourceCode(dartSourceCode)


  • Initial commit

Use this package as a library

1. Depend on it

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

  resolver: "^0.1.1"

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:resolver/resolver.dart';
Version Uploaded Documentation Archive
0.1.1 Dec 20, 2016 Go to the documentation of resolver 0.1.1 Download resolver 0.1.1 archive
0.1.0 Dec 20, 2016 Go to the documentation of resolver 0.1.0 Download resolver 0.1.0 archive


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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


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


Detected platforms: Flutter, other

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


  • Package is getting outdated.

    The package was released 77 weeks ago.

  • 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 resolver.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.21.0 <2.0.0
analyzer ^0.29.2 0.29.11 0.32.1
Transitive dependencies
args 0.13.7 1.4.3
async 2.0.7
charcode 1.1.1
cli_util 0.0.1+2 0.1.3
collection 1.14.10
convert 2.0.1
crypto 2.0.5
csslib 0.14.4
glob 1.1.5
html 0.13.3+1
isolate 1.1.0 2.0.1
logging 0.11.3+1
meta 1.1.5
package_config 1.0.3
plugin 0.2.0+2
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+8
when 0.2.0
which 0.1.3
yaml 2.1.14
Dev dependencies
path ^1.0.0 1.6.1
test ^0.12.17