@@ -19,63 +19,14 @@ Please submit issues and pull requests, help out, or just give encouragement.
19
19
20
20
## Links
21
21
22
- - [ Library Demos] ( http ://github.directcode.org/demos/)
22
+ - [ Library Demos] ( https ://github.directcode.org/demos/)
23
23
- [ Pub Package] ( https://pub.dartlang.org/packages/github )
24
24
- [ Wiki] ( https://github.com/SpinlockLabs/github.dart/wiki )
25
25
- [ Latest API reference] ( https://pub.dev/documentation/github/latest/ )
26
26
27
- ## Getting Started
27
+ ## Examples
28
28
29
- First, add the following to your pubspec.yaml:
30
-
31
- ``` yaml
32
- dependencies :
33
- github : ^6.0.0
34
- ` ` `
35
-
36
- Then import the library
37
-
38
- ` ` ` dart
39
- import 'package:github/github.dart';
40
- ```
41
-
42
- and then use it:
43
-
44
- ### Example
45
-
46
- ``` dart
47
- import 'package:github/github.dart';
48
-
49
- Future<void> main() async {
50
- /* Create a GitHub Client, with anonymous authentication by default */
51
- var github = GitHub();
52
-
53
- /*
54
- or Create a GitHub Client and have it try to find your token or credentials automatically
55
- In Flutter and in server environments this will search environment variables in this order
56
- GITHUB_ADMIN_TOKEN
57
- GITHUB_DART_TOKEN
58
- GITHUB_API_TOKEN
59
- GITHUB_TOKEN
60
- HOMEBREW_GITHUB_API_TOKEN
61
- MACHINE_GITHUB_API_TOKEN
62
- and then GITHUB_USERNAME and GITHUB_PASSWORD
63
-
64
- In a browser it will search keys in the same order first through the query string parameters
65
- and then in window sessionStorage
66
- */
67
- var github = GitHub(auth: findAuthenticationFromEnvironment());
68
-
69
- /* or Create a GitHub Client using an auth token */
70
- var github = GitHub(auth: Authentication.withToken('YourTokenHere'));
71
-
72
- /* or Create a GitHub Client using a username and password */
73
- var github = GitHub(auth: Authentication.basic('username', 'password'));
74
-
75
- Repository repo = await github.repositories.getRepository(RepositorySlug('user_or_org', 'repo_name'));
76
- /* Do Something with repo */
77
- }
78
- ```
29
+ See the examples in the example directory to learn how to use some of the features!
79
30
80
31
## Contacting Us
81
32
0 commit comments