git-touch-android-ios-app/packages/github_trending/README.md

42 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2022-10-16 10:31:08 +02:00
# github_trending
2022-10-16 10:50:58 +02:00
[![pub](https://img.shields.io/pub/v/github_trending.svg)](https://pub.dev/packages/github_trending) [![test](https://github.com/pd4d10/github-trending/workflows/test/badge.svg)](https://github.com/pd4d10/github-trending/actions?query=workflow:test)
2022-10-16 10:31:08 +02:00
A Dart library to get GitHub trending repositories and developers via [github-trending-api](https://github.com/huchenme/github-trending-api).
## Installation
Add `github_trending` as a [dependency in your pubspec.yaml file](https://flutter.dev/docs/development/packages-and-plugins/using-packages)
## Usage
```dart
import 'package:github_trending/github_trending.dart';
void main() async {
final trending = GithubTrending(prefix: 'https://gtrend.yapie.me');
// get trending repositories
var repos = await trending.getTrendingRepositories();
print(repos[0].name);
// specify time period
var weeklyRepos = await trending.getTrendingRepositories(since: 'weekly');
print(weeklyRepos[0].name);
// specify language
var dartRepos = await trending.getTrendingRepositories(language: 'dart');
print(dartRepos[0].language); // Dart
print(dartRepos[0].languageColor); // #00B4AB
}
```
## Credits
- [github-trending-api](https://github.com/huchenme/github-trending-api)
## License
MIT