createComment method Null safety

Future<IssueComment> createComment(
  1. RepositorySlug slug,
  2. int number,
  3. CreatePullRequestComment comment
)

Creates a new pull request comment.

API docs: https://developer.github.com/v3/pulls/comments/#create-a-comment

Implementation

Future<IssueComment> createComment(
    RepositorySlug slug, int number, CreatePullRequestComment comment) {
  return github.postJSON('/repos/${slug.fullName}/pulls/$number/comments',
      body: GitHubJson.encode(comment.toJson()),
      convert: (dynamic i) => PullRequestComment.fromJson(i),
      statusCode: 201) as Future<IssueComment>;
}