Skip to content

Commit b1b6ae1

Browse files
committed
Strong mode and some fixes
1 parent eddd543 commit b1b6ae1

File tree

9 files changed

+18
-16
lines changed

9 files changed

+18
-16
lines changed

lib/src/common/gists_service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class GistsService extends Service {
8787
/// API docs: https://developer.github.com/v3/gists/#edit-a-gist
8888
Future<Gist> editGist(String id,
8989
{String description, Map<String, String> files}) {
90-
var map = {};
90+
var map = <String, dynamic>{};
9191

9292
if (description != null) {
9393
map["description"] = description;

lib/src/common/model/gists.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class CreateGistComment {
170170
CreateGistComment(this.body);
171171

172172
String toJSON() {
173-
var map = {};
173+
var map = <String, dynamic>{};
174174
map['body'] = body;
175175
return JSON.encode(map);
176176
}

lib/src/common/model/repos_contents.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ class GitHubFile {
4848
/// Source Repository
4949
RepositorySlug sourceRepository;
5050

51-
static GitHubFile fromJSON(Map<String, dynamic> input, [RepositorySlug slug]) {
51+
static GitHubFile fromJSON(Map<String, dynamic> input,
52+
[RepositorySlug slug]) {
5253
if (input == null) return null;
5354

5455
return new GitHubFile()
@@ -112,7 +113,7 @@ class CreateFile {
112113
CreateFile(this.path, this.content, this.message);
113114

114115
String toJSON() {
115-
var map = <String, dynamic> {};
116+
var map = <String, dynamic>{};
116117
putValue("path", path, map);
117118
putValue("message", message, map);
118119
putValue("content", content, map);
@@ -130,7 +131,7 @@ class CommitUser {
130131
CommitUser(this.name, this.email);
131132

132133
Map<String, dynamic> toMap() {
133-
var map = {};
134+
var map = <String, dynamic>{};
134135

135136
putValue('name', name, map);
136137
putValue('email', email, map);
@@ -146,10 +147,11 @@ class ContentCreation {
146147

147148
ContentCreation(this.commit, this.content);
148149

149-
static ContentCreation fromJSON(input) {
150+
static ContentCreation fromJSON(Map<String, dynamic> input) {
150151
if (input == null) return null;
151152

152-
return new ContentCreation(RepositoryCommit.fromJSON(input['commit']),
153-
GitHubFile.fromJSON(input['content']));
153+
return new ContentCreation(
154+
RepositoryCommit.fromJSON(input['commit'] as Map<String, dynamic>),
155+
GitHubFile.fromJSON(input['content'] as Map<String, dynamic>));
154156
}
155157
}

lib/src/common/model/repos_forks.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class CreateFork {
77
CreateFork([this.organization]);
88

99
String toJSON() {
10-
var map = {};
10+
var map = <String, dynamic> {};
1111
putValue("organization", organization, map);
1212
return JSON.encode(map);
1313
}

lib/src/common/model/repos_hooks.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ class Hook {
3131

3232
Map<String, dynamic> config;
3333

34-
static Hook fromJSON(repoName, input) {
34+
static Hook fromJSON(String repoName, Map<String, dynamic> input) {
3535
if (input == null) return null;
3636

3737
return new Hook()
38-
..events = input['events']
38+
..events = input['events'] as List<String>
3939
..active = input['active']
4040
..name = input['name']
4141
..id = input['id']
4242
..repoName = repoName
4343
..updatedAt = parseDateTime(input['updated_at'])
4444
..createdAt = parseDateTime(input['created_at'])
45-
..config = input['config'];
45+
..config = input['config'] as Map<String, dynamic>;
4646
}
4747
}
4848

lib/src/common/model/repos_merging.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CreateMerge {
1111
CreateMerge(this.base, this.head);
1212

1313
String toJSON() {
14-
var map = {};
14+
var map = <String, dynamic> {};
1515
putValue("base", base, map);
1616
putValue("head", head, map);
1717
putValue("commit_message", commitMessage, map);

lib/src/common/model/repos_releases.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class CreateRelease {
154154
CreateRelease(this.tagName);
155155

156156
String toJSON() {
157-
var map = {};
157+
var map = <String, dynamic>{};
158158
putValue("tag_name", tagName, map);
159159
putValue("name", name, map);
160160
putValue("body", body, map);

lib/src/common/model/repos_statuses.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class CreateStatus {
5858
CreateStatus(this.state);
5959

6060
String toJSON() {
61-
var map = {};
61+
var map = <String, dynamic>{};
6262
putValue("state", state, map);
6363
putValue("target_url", targetUrl, map);
6464
putValue("description", description, map);

lib/src/common/pulls_service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PullRequestsService extends Service {
3535
/// API docs: https://developer.github.com/v3/pulls/#update-a-pull-request
3636
Future<PullRequest> edit(RepositorySlug slug, int number,
3737
{String title, String body, String state}) {
38-
var map = {};
38+
var map = <String, dynamic>{};
3939
putValue("title", title, map);
4040
putValue("body", body, map);
4141
putValue("state", state, map);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy