@@ -58,10 +58,10 @@ class Issue {
58
58
@ApiName ("closed_by" )
59
59
User closedBy;
60
60
61
- static Issue fromJSON (input) {
61
+ static Issue fromJSON (Map < String , dynamic > input) {
62
62
if (input == null ) return null ;
63
63
64
- var labels = input['labels' ];
64
+ var labels = input['labels' ] as List < Map < String , dynamic >> ;
65
65
if (labels == null ) labels = [];
66
66
67
67
return new Issue ()
@@ -74,9 +74,11 @@ class Issue {
74
74
..user = User .fromJSON (input['user' ])
75
75
..labels = labels.map (IssueLabel .fromJSON).toList (growable: false )
76
76
..assignee = User .fromJSON (input['assignee' ])
77
- ..milestone = Milestone .fromJSON (input['milestone' ])
77
+ ..milestone =
78
+ Milestone .fromJSON (input['milestone' ] as Map <String , dynamic >)
78
79
..commentsCount = input['comments' ]
79
- ..pullRequest = IssuePullRequest .fromJSON (input['pull_request' ])
80
+ ..pullRequest = IssuePullRequest
81
+ .fromJSON (input['pull_request' ] as Map <String , dynamic >)
80
82
..createdAt = parseDateTime (input['created_at' ])
81
83
..updatedAt = parseDateTime (input['updated_at' ])
82
84
..closedAt = parseDateTime (input['closed_at' ])
@@ -100,7 +102,7 @@ class IssueRequest {
100
102
IssueRequest ();
101
103
102
104
String toJSON () {
103
- var map = {};
105
+ var map = < String , dynamic > {};
104
106
putValue ("title" , title, map);
105
107
putValue ("body" , body, map);
106
108
putValue ("labels" , labels, map);
@@ -125,7 +127,7 @@ class IssuePullRequest {
125
127
@ApiName ("patch_url" )
126
128
String patchUrl;
127
129
128
- static IssuePullRequest fromJSON (input) {
130
+ static IssuePullRequest fromJSON (Map < String , dynamic > input) {
129
131
if (input == null ) return null ;
130
132
131
133
return new IssuePullRequest ()
@@ -155,7 +157,7 @@ class IssueComment {
155
157
@ApiName ("issue_url" )
156
158
String issueUrl;
157
159
158
- static IssueComment fromJSON (input) {
160
+ static IssueComment fromJSON (Map < String , dynamic > input) {
159
161
if (input == null ) return null ;
160
162
161
163
return new IssueComment ()
@@ -178,7 +180,7 @@ class IssueLabel {
178
180
/// Label Color
179
181
String color;
180
182
181
- static IssueLabel fromJSON (input) {
183
+ static IssueLabel fromJSON (Map < String , dynamic > input) {
182
184
if (input == null ) return null ;
183
185
184
186
assert (input['name' ] != null );
@@ -189,6 +191,7 @@ class IssueLabel {
189
191
..color = input['color' ];
190
192
}
191
193
194
+ @override
192
195
String toString () => 'IssueLabel: $name ' ;
193
196
}
194
197
@@ -232,7 +235,7 @@ class Milestone {
232
235
@ApiName ("due_on" )
233
236
DateTime dueOn;
234
237
235
- static Milestone fromJSON (input) {
238
+ static Milestone fromJSON (Map < String , dynamic > input) {
236
239
if (input == null ) return null ;
237
240
238
241
return new Milestone ()
@@ -261,7 +264,7 @@ class CreateMilestone {
261
264
CreateMilestone (this .title);
262
265
263
266
String toJSON () {
264
- var map = {};
267
+ var map = < String , dynamic > {};
265
268
putValue ("title" , title, map);
266
269
putValue ("state" , state, map);
267
270
putValue (description, description, map);
0 commit comments