github_trend 0.1.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new58

Github trending api for dart #

Get the popular repository on github,You can also get all the languages.And convert the data into Map, List, JSON

Usage #

A simple usage example:

GithubTrend githubTrend = GithubTrend();
try {
  // default time language
  List<Map<String, dynamic>> defaultArray = await githubTrend.toList();
  print(defaultArray);
} catch (e) {
  // get origin response
  githubTrend.response;
  print(e);
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.2 #

  • Fix duplicate requests when getting a language

0.1.2 #

  • Fix error package name in doc

0.1.1 #

  • Rename class method
  • Add fetch languages method to class and example,test
  • Rename package name

0.1.0 #

  • Initial version, created by Stagehand

example/README.md

import 'package:github_trend/github_trending.dart';

main() async {
  GithubTrend githubTrend = GithubTrend();
  // fetch languages
  List<String> languages = await githubTrend.fetchLanguages();
  print(languages);
  
  // default time language
  try {
    List<Map<String, dynamic>> defaultArray =
        await githubTrend.getTrendingRepos();
    print(defaultArray);
  } catch (e) {
    // get origin response
    githubTrend.response;
    print(e);
  }

  // rust language and default time
  List<Map<String, dynamic>> rustArray =
      await githubTrend.getTrendingRepos(language: 'rust');
  print(rustArray);

  // rust language and last weekly
  List<Map<String, dynamic>> rustWeekArray =
      await githubTrend.getTrendingRepos(language: 'rust', since: 'weekly');
  print(rustWeekArray);

  // return default trending when pass error since and language params.
  List<Map<String, dynamic>> rustWeekArrayerror =
      await githubTrend.getTrendingRepos(language: 'error', since: 'error');
  print(rustWeekArrayerror);
}

Use this package as a library

1. Depend on it

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


dependencies:
  github_trend: ^0.1.3

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:github_trend/github_trend.dart';
  
Version Uploaded Documentation Archive
0.1.3 Apr 16, 2019 Go to the documentation of github_trend 0.1.3 Download github_trend 0.1.3 archive
0.1.2 Apr 15, 2019 Go to the documentation of github_trend 0.1.2 Download github_trend 0.1.2 archive
0.1.1 Apr 15, 2019 Go to the documentation of github_trend 0.1.1 Download github_trend 0.1.1 archive
0.1.0 Apr 15, 2019 Go to the documentation of github_trend 0.1.0 Download github_trend 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
15
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
html ^0.14.0+1 0.14.0+1
http ^0.12.0+2 0.12.0+2
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
csslib 0.15.0
http_parser 3.1.3
meta 1.1.7
path 1.6.2
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.0.0 1.5.0
test ^1.0.0