github 6.0.0-dev.1.0

  • Readme
  • Changelog
  • Installing
  • 91

GitHub for Dart #


This is a library for interacting with GitHub in Dart. It works on all platforms including web, server, and Flutter. Please submit issues and pull requests, help out, or just give encouragement.

Notice: We are looking for contributors. If you're interested or have questions, join the chat at

Features #

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

Getting Started #

First, add the following to your pubspec.yaml:

  github: ^5.0.0

Then import the library

For the browser use:

import 'package:github/browser.dart';

and for the server or Flutter use:

import 'package:github/github.dart';

and then use it:


import 'package:github/browser.dart';

void main() async {
  /* Create a GitHub Client */
  var github = GitHub();

  /* or Create a GitHub Client using an auth token */
  var github = createGitHubClient(auth: new Authentication.withToken("YourTokenHere"));  

  Repository repo = await github.repositories.getRepository(new RepositorySlug("user_or_org", "repo_name"));
  /* Do Something with repo */

Contacting Us #

Join our Gitter chat at

v6.0.0 #

  • There's a single entrypoint now: package:github/github.dart
  • For web: browser specific helper methods have moved. use import package:github/browser_helper.dart (renderMarkdown, and createAvatorImage)
  • createGithubClient(...) has been removed. Just create a GitHub object directly now.
  • findAuthenticationFromEnvironment now works in both server/flutter and web environments
    • On the web, it will check the query string first, then localstorage
  • all static methods are now factory constructors
  • fromJSON is now fromJson everywhere
  • toJSON is now toJson everywhere
  • Use JsonSerializable everywhere
  • removed deprecated items
  • renamed some fields with ID at the end to be Id
  • most model constructors now have named parameters for all properties

v5.5.0 #

v5.4.0 #

v5.3.0 #

  • Add the ability to upload release assets.
  • Add the ability to get an existing release by tag name.


  • The draft and prerelease properties in the CreateRelease and Release
  • classes have been renamed to isDraft and isPrerelease for clarity.
  • Release.targetCommitsh has been renamed to Release.targetCommitish.
  • The release parameter in RepositoriesService.createRelease has been renamed to createRelease.
  • RepositoriesService.getRelease has been renamed to RepositoriesService.getReleaseById

v5.2.0 #

v5.1.0 #

v5.0.2 #

v5.0.1 #

v5.0.0 #

  • BREAKING RepositoriesService.listCollaborators now returns Stream<Collaborator> instead of Stream<User>.
    • Collaborator is a new type that includes collaborator-specific information.

v4.1.1 #

  • Require at least Dart 2.1.0.

v4.1.0 #

  • Fix return type of RepositoriesService.listContributors.
  • Fix return type of RepositoriesService.createRelease.
  • Fixed RepositoriesService.listContributorStats.
    • Removed unsupported limit parameter.
    • Removed flaky retry logic. Instead, NotReady is thrown, which can be used to decide to retry at the call site.
    • Made associated classes ContributorStatistics and ContributorWeekStatistics immutable. Since these classes are only meant as return values, we're not treating this as a breaking change.
  • Added Stream<CodeSearchResults> search API
    • Made CodeSearchResults class to hold search results
    • Made CodeSearchItem class to hold each search result item
    • Added a code search example

v4.0.1 #

  • Fix cast errors in event and issue queries.

v4.0.0 #

  • Make fields in many objects read-only.
  • Initial support for comparing commits.
  • Require at least Dart 2.0.0-dev.36.
  • Fix a number of type issues dealing with JSON.
  • BREAKING Removed ExploreServiceGitHub.explore.
  • BREAKING Removed MiscService.listOctodex.
  • BREAKING Removed BlogService -

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

Use this package as a library

1. Depend on it

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

  github: ^6.0.0-dev.1.0

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:github/github.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 Apr 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.7

Maintenance suggestions

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

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

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
http ^0.12.0 0.12.0+4
http_parser ^3.1.1 3.1.4
json_annotation >=2.0.0 <4.0.0 3.0.1
meta ^1.1.0 1.1.8
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.12
path 1.6.4
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_runner any
build_test any
build_web_compilers any
json_serializable ^3.2.2
mockito ^3.0.0
pedantic ^1.0.0 1.9.0
test ^1.3.0
yaml ^2.2.0