pub_client 3.0.3

Build Status Pub

pub_client #

A library for interacting with the REST API for Pub ( This package currently uses Dartson to decode the JSON responses from Pub into concrete types.

Supported API Calls #

  • getPageOfPackages(pageNumber) - Retrieves a single page of packages from Pub with the most recently updated packages first.
  • getAllPackages() - Retrieves all possible pages of packages. NOTE: This method has the potential to generate a lot of network traffic.
  • getPackage(packageName) - Retrieves a single package by it's name.

Example Usage #

import "package:pub_client/pub_client.dart";

main() async {
    PubClient client = new PubClient();
    FullPackage package = await client.getPackage("test");

v3.0.3 #

  • Fix TypeError in Dependencies.toJson
  • Update dependencies


import 'package:pub_client/pub_client.dart';

main() async {
  var client = new PubClient();
  var package = await client.getPackage("test");

Use this package as a library

1. Depend on it

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

  pub_client: ^3.0.3

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:pub_client/pub_client.dart';
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 Sep 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21


Detected platforms: Flutter, web, other

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

Health issues and suggestions

Document public APIs. (-1 points)

149 out of 149 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/pub_client.dart. (-3.45 points)

Analysis of lib/pub_client.dart reported 7 hints, including:

line 16 col 22: Don't explicitly initialize variables to null.

line 16 col 35: Use = to separate a named parameter from its default value.

line 16 col 53: Use = to separate a named parameter from its default value.

line 28 col 23: Don't type annotate initializing formals.

line 28 col 43: Don't type annotate initializing formals.

Fix lib/src/models.g.dart. (-1.99 points)

Analysis of lib/src/models.g.dart reported 4 hints:

line 139 col 14: The declaration '_$DependenciesFromJson' isn't referenced.

line 157 col 22: The declaration '_$DependenciesToJson' isn't referenced.

line 173 col 15: The declaration '_$GitDependencyFromJson' isn't referenced.

line 180 col 22: The declaration '_$GitDependencyToJson' isn't referenced.

Format lib/src/models.dart.

Run dartfmt to format lib/src/models.dart.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (json_annotation).


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
http >=0.11.0 <0.13.0 0.12.0+2
json_annotation >=1.0.0 <3.0.0 2.4.0 3.0.0
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.7
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
build_runner >=0.10.1 <2.0.0
json_serializable >=1.0.1 <3.0.0
path ^1.6.2 1.6.4
test any