toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      'number': number,
      'node_id': nodeId,
      'title': title,
      'body': body,
      'state': state,
      'labels': [for (final l in labels) {'name': l}],
      'user': {'login': author, 'id': author.hashCode.abs()},
      'created_at': createdAt.toIso8601String(),
      'updated_at': updatedAt.toIso8601String(),
      if (closedAt != null) 'closed_at': closedAt!.toIso8601String(),
      'comments': comments.length,
      'html_url': 'https://fake.github.test/issues/$number',
    };