flutter_gh_fetch 0.0.3 flutter_gh_fetch: ^0.0.3 copied to clipboard
Minimal package for fetching GitHub user info and paginated list of repositories
example/flutter_gh_fetch_example.dart
import 'package:flutter_gh_fetch/flutter_gh_fetch.dart';
/// Example class showcasing the use of the library
/// in an object-oriented syntax
class FlutterGhFetchExample {
FlutterGHFetch _ghFetch;
FlutterGhFetchExample() {
// Initialize FlutterGhFetch
final String accessToken = "my-access-token";
_ghFetch = FlutterGHFetch(accessToken);
}
Future<void> allMethods() async {
// First, call the init() method to initialize the whole thingy
await _ghFetch.init();
// Query user data
print(await _ghFetch.queryUserData());
// Repository queries and combos you can use
print(await _ghFetch.queryRepositoryData(5));
print(await _ghFetch.queryRepositoryData(
5,
after: 'insert-cursor',
));
print(await _ghFetch.queryRepositoryData(
5,
filterPrivate: true,
));
print(await _ghFetch.queryRepositoryData(
5,
after: 'insert-cursor',
filterPrivate: true,
));
// Query total number of repos
print(await _ghFetch.queryTotalRepoCount());
}
}