Skip to content

Commit e0d0472

Browse files
committed
tweak readme
- single quotes - remove optional new keyword
1 parent 0bf168f commit e0d0472

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ import 'package:github/github.dart';
4141

4242
and then use it:
4343

44-
**Example**
44+
### Example
45+
4546
```dart
4647
import 'package:github/github.dart';
4748
4849
Future<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

0 commit comments

Comments
 (0)