pub_client 3.0.3

Build Status Pub

pub_client #

A library for interacting with the REST API for Pub (pub.dartlang.org/api). 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");
    print(package.latest.version);
}

v3.0.3 #

  • Fix TypeError in Dependencies.toJson
  • Update dependencies

example/main.dart

import 'package:pub_client/pub_client.dart';

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

Use this package as a library

1. Depend on it

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


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
94
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
68
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

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 function '_$DependenciesFromJson' isn't used.

line 157 col 22: The function '_$DependenciesToJson' isn't used.

line 173 col 15: The function '_$GitDependencyFromJson' isn't used.

line 180 col 22: The function '_$GitDependencyToJson' isn't used.

Format lib/src/models.dart.

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

Dependencies

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
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.7
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.4
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.2
test any

Admin