-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ratakondala Arun
committed
Dec 29, 2020
1 parent
1893631
commit 7154251
Showing
11 changed files
with
234 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.dart_tool | ||
.packages | ||
.env | ||
doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
part of gitterapi; | ||
|
||
/// | ||
class ApiKeys { | ||
/// Authorization token required to connect to Gitter API. | ||
final String authToken; | ||
|
||
/// Creates a instance of [this]. | ||
const ApiKeys(this.authToken); | ||
|
||
/// Returns a instance of [ApiKeys] | ||
/// by fetching `authToken` from Environment. | ||
/// | ||
/// This looksup for `AUTH_TOKEN` env variable. | ||
/// | ||
factory ApiKeys.fromEnv() { | ||
return ApiKeys(String.fromEnvironment('AUTH_TOKEN')); | ||
/// ### Parameters: | ||
/// | ||
/// - `tokenVar`: Specifies which env variable to look for token. | ||
/// By default it looks for AUTH_TOKEN. | ||
/// | ||
factory ApiKeys.fromEnv({String tokenVar = 'AUTH_TOKEN'}) { | ||
return ApiKeys(String.fromEnvironment(tokenVar)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.