github 3.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 73

GitHub for Dart

This is a Client Library for GitHub in Dart. I wrote this out of necessity, and then when I got a great reaction from the Dart community, I decided to put a lot of effort into it.

Please submit issues and pull requests, join my IRC channel (#directcode on irc.esper.net), help out, or just give me encouragement.

Notice: We are looking for major contributors. Contact us by email or on IRC!

Features

Current

  • Works on the Server and in the Browser
  • Really Fast
  • Plugable API
  • Supports Authentication
  • Builtin OAuth2 Flow
  • Hook Server Helper

Work in Progress

  • Support all the GitHub APIs (Progress: 98%)

Getting Started

First, add the following to your pubspec.yaml:

dependencies:
  github: "^3.0.0"

Then import the library and use it:

For the Server

import 'package:github/server.dart';

void main() {
  /* Creates a GitHub Client */
  var github = createGitHubClient();
  
  github.repositories.getRepository(new RepositorySlug("DirectMyFile", "github.dart")).then((Repository repo) {
    /* Do Something */
  });
}

For the Browser

import 'package:github/browser.dart';

void main() {
  /* Creates a GitHub Client */
  var github = createGitHubClient();
  
  github.repositories.getRepository(new RepositorySlug("DirectMyFile", "github.dart")).then((Repository repo) {
    /* Do Something */
  });
}

Authentication

To use a GitHub token:

var github = createGitHubClient(auth: new Authentication.withToken("YourTokenHere"));

Contacting Us

You can find us on irc.esper.net and irc.freenode.net at #directcode.

v3.0.0

  • BREAKING Removed a number of top-level methods from the public API.
  • BREAKING Removed markdown.dart library – use the markdown package instead.
  • BREAKING Removed the dates.dart library.

v2.3.2

  • Automatically attempt to find GitHub user information in the process environment when running on the standalone VM.
  • Add ref parameter to getReadme method for the repository service.

v2.3.1

  • Cache base64 decoded text property in GitHubFile
  • Fix Bug in EventPoller
  • Added id to Milestone

v2.3.0

  • Moved CHANGELOG content back to repo.
  • Added rateLimitLimit, rateLimitRemaining and rateLimitReset to GitHub.
  • Added id to Issue
  • Added direction, sort and since optional arguments to IssueService.listByRepo.

v2.1.0

NOTICE: This is a major breaking release. This really should have been v2.0.0

  • New Service based API
  • Git Data API Fully Implemented

v2.0.0

  • File class renamed to GitHubFile (Breaking Change)
  • New Integration Tests (Tests the actual GitHub API).
  • Unit Testing System fully setup.
  • Git Data API partially implemented (this is a breaking change because of the new service system).
  • Fixes issues in fetching multiple repositories and users (fetching was very unreliable).
  • Adds a Markdown Rendering Helper (for rendering markdown in an element).
  • Team Membership API Implemented.
  • OAuth2 Flow API now uses some methods in the HTTP Library.
  • Organization Membership Updated to new API Changes.
  • Hook Server performance improvements.
  • Commit JSON Parsing now handles errors correctly.
  • Add Issue.toggleState() method which toggles it from open to closed or vice-versa.
  • Add Issue.isOpen and Issue.isClosed getters.

v1.3.1

  • A few bug fixes.
  • New Tests
  • Benchmarks
  • Markdown Generation Library

v1.3.0

v1.0.1

v1.0.0

v0.6.7

v0.6.6

v0.6.5

v0.6.4

v0.6.3

v0.6.2

v0.6.1

v0.6.0

v0.5.9

All the things!

v0.3.0

v0.2.0

v0.1.0

Initial Version

1. Depend on it

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


dependencies:
  github: "^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 packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:github/browser.dart';

import 'package:github/server.dart';
        
Version Uploaded Documentation Archive
3.0.2 Jul 12, 2017 Go to the documentation of github 3.0.2 Download github 3.0.2 archive
3.0.0 Aug 29, 2016 Go to the documentation of github 3.0.0 Download github 3.0.0 archive
2.3.1+1 Jan 13, 2016 Go to the documentation of github 2.3.1+1 Download github 2.3.1+1 archive
2.3.1 Dec 4, 2015 Go to the documentation of github 2.3.1 Download github 2.3.1 archive
2.3.0 Oct 3, 2015 Go to the documentation of github 2.3.0 Download github 2.3.0 archive
2.2.3+1 Jun 30, 2015 Go to the documentation of github 2.2.3+1 Download github 2.2.3+1 archive
2.2.3 Jun 29, 2015 Go to the documentation of github 2.2.3 Download github 2.2.3 archive
2.2.2 Apr 16, 2015 Go to the documentation of github 2.2.2 Download github 2.2.2 archive
2.2.1 Apr 12, 2015 Go to the documentation of github 2.2.1 Download github 2.2.1 archive
2.2.0 Apr 12, 2015 Go to the documentation of github 2.2.0 Download github 2.2.0 archive

All 48 versions...

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Dec 6, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
73
Health:
Code health derived from static analysis. [more]
88
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
51
Overall score:
Weighted score of the above. [more]
73

Platforms

Detected platforms: Flutter, server, web

all of the above

Suggestions

  • Fix lib/src/common/explore_service.dart.

    Strong-mode analysis of lib/src/common/explore_service.dart failed with the following error:

    line: 64 col: 30
    A value of type 'Element' can't be assigned to a variable of type 'String'.

  • Fix lib/src/common/orgs_service.dart.

    Strong-mode analysis of lib/src/common/orgs_service.dart failed with the following error:

    line: 79 col: 9
    The argument type 'Map<String, dynamic>' can't be assigned to the parameter type 'String'.

  • Fix further 3 Dart files.

    Similar analysis of the following files failed:

    • lib/src/common/users_service.dart
    • lib/src/common/repos_service.dart
    • lib/src/common/activity_service.dart
  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
html >=0.12.0 <0.14.0 0.13.2
http ^0.11.3 0.11.3+16
markdown ^0.11.1 0.11.4 1.0.0
quiver >=0.20.0 <0.25.0 0.24.0 0.26.2
xml ^2.0.0 2.6.0
Transitive dependencies
args 1.2.0
async 2.0.1
charcode 1.1.1
collection 1.14.3
csslib 0.14.1
http_parser 3.1.1
logging 0.11.3+1
matcher 0.12.1+4
path 1.5.1
petitparser 1.6.1
source_span 1.4.0
stack_trace 1.9.1
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+3
Dev dependencies
browser ^0.10.0+2
mockito ^1.0.1
test ^0.12.0