package_resolver 1.0.10

  • Readme
  • Changelog
  • Installing
  • 91

A package that defines a common class, PackageResolver, for defining how to resolve package: URIs. This class may be based on the current isolate's package resolution strategy, but it may also be explicitly defined by the user—for example, you could create a resolver that represents the strategy used to compile a .dart.js file.

The Dart VM provides two mutually exclusive means of resolving package: URIs: a package spec and a package root.

  • A package spec usually comes in the form of a .packages file on the filesystem. It defines an individual root URL for each package name, so that package:$name/$path resolves to $root/$path.

  • A package root is a single URL that acts as the base for all package: URIs, so that package:$name/$path resolves to $base/$name/$path.

This normalizes access to these resolution schemes, and makes it easy for code to resolve package URIs no matter where the resolution information comes from.

1.0.10 #

  • Use conditional imports to avoid dart:isolate imports on the web.
  • Bump minimum SDK to 2.1.0.

1.0.9 #

  • Identical to 1.0.6 - republishing with a higher version number to get around issues with conditional dart:isolate imports on the version of build_modules which is compatible with the 2.0.0 SDK.

1.0.8 #

  • Fix issue on Dart 2.0.0.

1.0.7 #

  • Use conditional imports to avoid dart:isolate imports on the web.

1.0.6 #

  • Support package:http version 0.12.x.

1.0.5 #

  • Use conditional imports to avoid dart:io imports on the web.

1.0.4 #

  • Set max SDK version to <3.0.0, and adjust other dependencies.

1.0.3 #

  • Update SDK version.
  • Stop using deprecated UTF8 constant.

1.0.2 #

  • Don't crash on URIs without path components.

1.0.1 #

  • Internal changes only.

1.0.0 #

  • Initial version.

Use this package as a library

1. Depend on it

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


dependencies:
  package_resolver: ^1.0.10

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:package_resolver/package_resolver.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
96
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
78
Overall:
Weighted score of the above. [more]
91
Learn more about scoring.

We analyzed this package on Nov 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:package_resolver/package_resolver.dart.

Health suggestions

Fix lib/src/package_config_resolver.dart. (-1.99 points)

Analysis of lib/src/package_config_resolver.dart reported 4 hints:

line 25 col 18: Unnecessary new keyword.

line 27 col 12: Unnecessary new keyword.

line 34 col 34: Unnecessary new keyword.

line 45 col 7: Unnecessary new keyword.

Fix lib/src/utils.dart. (-1.99 points)

Analysis of lib/src/utils.dart reported 4 hints:

line 37 col 11: Unnecessary new keyword.

line 55 col 11: Unnecessary new keyword.

line 58 col 11: Unnecessary new keyword.

line 73 col 9: Unnecessary new keyword.

Fix lib/src/current_isolate_resolver.dart. (-1.49 points)

Analysis of lib/src/current_isolate_resolver.dart reported 3 hints:

line 37 col 30: Unnecessary new keyword.

line 46 col 12: Unnecessary new keyword.

line 69 col 30: Unnecessary new keyword.

Fix additional 5 files with analysis or formatting issues. (-4.49 points)

Additional issues in the following files:

  • lib/src/utils_io.dart (3 hints)
  • lib/src/package_resolver.dart (2 hints)
  • lib/src/sync_package_resolver.dart (2 hints)
  • lib/src/no_package_resolver.dart (1 hint)
  • lib/src/package_root_resolver.dart (1 hint)

Maintenance suggestions

The package description is too short. (-12 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and package_resolver.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
collection ^1.9.0 1.14.12
http >0.11.0 <0.13.0 0.12.0+2
package_config >=0.1.0 <2.0.0 1.1.0
path ^1.0.0 1.6.4
Transitive dependencies
async 2.4.0
charcode 1.1.2
http_parser 3.1.3
meta 1.1.8
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
shelf ^0.7.0
stack_trace ^1.9.2
test ^1.2.0