Commit.fromJson constructor

Commit.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Commit.fromJson(Map<String, dynamic> json) {
  return Commit(
    additionalData: json['additionalData'] as String?,
    author: json['author'] != null
        ? UserInfo.fromJson(json['author'] as Map<String, dynamic>)
        : null,
    commitId: json['commitId'] as String?,
    committer: json['committer'] != null
        ? UserInfo.fromJson(json['committer'] as Map<String, dynamic>)
        : null,
    message: json['message'] as String?,
    parents: (json['parents'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    treeId: json['treeId'] as String?,
  );
}