File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -41,15 +41,17 @@ import 'package:github/github.dart';
4141
4242and then use it:
4343
44- ** Example**
44+ ### Example
45+
4546``` dart
4647import 'package:github/github.dart';
4748
4849Future<void> main() async {
4950 /* Create a GitHub Client, with anonymous authentication by default */
5051 var github = GitHub();
5152
52- /* or Create a GitHub Client and have it try to find your token or credentials automatically
53+ /*
54+ or Create a GitHub Client and have it try to find your token or credentials automatically
5355 In Flutter and in server environments this will search environment variables in this order
5456 GITHUB_ADMIN_TOKEN
5557 GITHUB_DART_TOKEN
@@ -65,14 +67,13 @@ Future<void> main() async {
6567 var github = GitHub(auth: findAuthenticationFromEnvironment());
6668
6769 /* or Create a GitHub Client using an auth token */
68- var github = GitHub(auth: new Authentication.withToken(" YourTokenHere" ));
70+ var github = GitHub(auth: Authentication.withToken(' YourTokenHere' ));
6971
7072 /* or Create a GitHub Client using a username and password */
71- var github = GitHub(auth: new Authentication.basic('username', 'password'));
73+ var github = GitHub(auth: Authentication.basic('username', 'password'));
7274
73- Repository repo = await github.repositories.getRepository(new RepositorySlug(" user_or_org", " repo_name" ));
75+ Repository repo = await github.repositories.getRepository(RepositorySlug(' user_or_org', ' repo_name' ));
7476 /* Do Something with repo */
75-
7677}
7778```
7879
You can’t perform that action at this time.
0 commit comments