pub_client 3.0.2

  • README.md
  • Example
  • Installing
  • Versions
  • 66

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);
}

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.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_client/pub_client.dart';
  
Version Uploaded Documentation Archive
3.0.2 Sep 13, 2018 Go to the documentation of pub_client 3.0.2 Download pub_client 3.0.2 archive
3.0.0 Sep 13, 2018 Go to the documentation of pub_client 3.0.0 Download pub_client 3.0.0 archive
2.0.0 Aug 9, 2018 Go to the documentation of pub_client 2.0.0 Download pub_client 2.0.0 archive
1.0.8 Jul 23, 2015 Go to the documentation of pub_client 1.0.8 Download pub_client 1.0.8 archive
1.0.7 Jun 10, 2015 Go to the documentation of pub_client 1.0.7 Download pub_client 1.0.7 archive
1.0.5 Apr 16, 2015 Go to the documentation of pub_client 1.0.5 Download pub_client 1.0.5 archive
1.0.4 Apr 16, 2015 Go to the documentation of pub_client 1.0.4 Download pub_client 1.0.4 archive
1.0.3 Apr 16, 2015 Go to the documentation of pub_client 1.0.3 Download pub_client 1.0.3 archive
1.0.2 Apr 15, 2015 Go to the documentation of pub_client 1.0.2 Download pub_client 1.0.2 archive
1.0.1 Apr 15, 2015 Go to the documentation of pub_client 1.0.1 Download pub_client 1.0.1 archive

All 11 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
48
Health:
Code health derived from static analysis. [more]
88
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
66
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

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 (-10 points)

136 out of 136 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

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/pub_client.dart.

Run dartfmt to format lib/pub_client.dart.

Format lib/src/models.dart.

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

Maintenance issues and suggestions

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
http ^0.11.3+17 0.11.3+17 0.12.0
json_annotation ^1.0.0 1.2.0 2.0.0
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.6
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
Dev dependencies
build_runner ^0.10.1
json_serializable ^1.0.1
path ^1.6.2 1.6.2
test any