operator == method
The equality operator.
The default behavior for all Objects is to return true if and
only if this object and other
are the same object.
Override this method to specify a different equality relation on a class. The overriding method must still be an equivalence relation. That is, it must be:
-
Total: It must return a boolean for all arguments. It should never throw.
-
Reflexive: For all objects
o
,o == o
must be true. -
Symmetric: For all objects
o1
ando2
,o1 == o2
ando2 == o1
must either both be true, or both be false. -
Transitive: For all objects
o1
,o2
, ando3
, ifo1 == o2
ando2 == o3
are true, theno1 == o3
must be true.
The method should also be consistent over time, so whether two objects are equal should only change if at least one of the objects was modified.
If a subclass overrides the equality operator, it should override the hashCode method as well to maintain consistency.
Implementation
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is GithubRepositoryModel &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.fullName, fullName) ||
other.fullName == fullName) &&
(identical(other.owner, owner) || other.owner == owner) &&
(identical(other.organization, organization) ||
other.organization == organization) &&
(identical(other.language, language) ||
other.language == language) &&
(identical(other.license, license) || other.license == license) &&
(identical(other.permissions, permissions) ||
other.permissions == permissions) &&
(identical(other.isPrivate, isPrivate) ||
other.isPrivate == isPrivate) &&
(identical(other.isFork, isFork) || other.isFork == isFork) &&
(identical(other.isTemplate, isTemplate) ||
other.isTemplate == isTemplate) &&
(identical(other.description, description) ||
other.description == description) &&
(identical(other.masterBranch, masterBranch) ||
other.masterBranch == masterBranch) &&
(identical(other.mergeCommitMessage, mergeCommitMessage) ||
other.mergeCommitMessage == mergeCommitMessage) &&
(identical(other.mergeCommitTitle, mergeCommitTitle) ||
other.mergeCommitTitle == mergeCommitTitle) &&
(identical(other.squashMergeCommitMessage, squashMergeCommitMessage) ||
other.squashMergeCommitMessage == squashMergeCommitMessage) &&
(identical(other.squashMergeCommitTitle, squashMergeCommitTitle) ||
other.squashMergeCommitTitle == squashMergeCommitTitle) &&
(identical(other.nodeId, nodeId) || other.nodeId == nodeId) &&
(identical(other.tempCloneToken, tempCloneToken) ||
other.tempCloneToken == tempCloneToken) &&
(identical(other.visibility, visibility) ||
other.visibility == visibility) &&
const DeepCollectionEquality().equals(other.topics, topics) &&
(identical(other.archived, archived) ||
other.archived == archived) &&
(identical(other.disabled, disabled) ||
other.disabled == disabled) &&
(identical(other.hasIssues, hasIssues) ||
other.hasIssues == hasIssues) &&
(identical(other.hasWiki, hasWiki) || other.hasWiki == hasWiki) &&
(identical(other.hasDownloads, hasDownloads) ||
other.hasDownloads == hasDownloads) &&
(identical(other.hasPages, hasPages) ||
other.hasPages == hasPages) &&
(identical(other.hasDiscussions, hasDiscussions) ||
other.hasDiscussions == hasDiscussions) &&
(identical(other.hasProjects, hasProjects) ||
other.hasProjects == hasProjects) &&
(identical(other.allowAutoMerge, allowAutoMerge) ||
other.allowAutoMerge == allowAutoMerge) &&
(identical(other.allowForking, allowForking) ||
other.allowForking == allowForking) &&
(identical(other.allowMergeCommit, allowMergeCommit) ||
other.allowMergeCommit == allowMergeCommit) &&
(identical(other.allowRebaseMerge, allowRebaseMerge) ||
other.allowRebaseMerge == allowRebaseMerge) &&
(identical(other.allowSquashMerge, allowSquashMerge) ||
other.allowSquashMerge == allowSquashMerge) &&
(identical(other.allowUpdateBranch, allowUpdateBranch) ||
other.allowUpdateBranch == allowUpdateBranch) &&
(identical(other.anonymousAccessEnabled, anonymousAccessEnabled) ||
other.anonymousAccessEnabled == anonymousAccessEnabled) &&
(identical(other.deleteBranchOnMerge, deleteBranchOnMerge) ||
other.deleteBranchOnMerge == deleteBranchOnMerge) &&
(identical(other.webCommitSignoffRequired, webCommitSignoffRequired) ||
other.webCommitSignoffRequired == webCommitSignoffRequired) &&
(identical(other.size, size) || other.size == size) &&
(identical(other.stargazersCount, stargazersCount) ||
other.stargazersCount == stargazersCount) &&
(identical(other.watchersCount, watchersCount) ||
other.watchersCount == watchersCount) &&
(identical(other.forksCount, forksCount) ||
other.forksCount == forksCount) &&
(identical(other.openIssuesCount, openIssuesCount) ||
other.openIssuesCount == openIssuesCount) &&
(identical(other.subscribersCount, subscribersCount) ||
other.subscribersCount == subscribersCount) &&
(identical(other.networkCount, networkCount) || other.networkCount == networkCount) &&
(identical(other.htmlUrl, htmlUrl) || other.htmlUrl == htmlUrl) &&
(identical(other.cloneUrl, cloneUrl) || other.cloneUrl == cloneUrl) &&
(identical(other.sshUrl, sshUrl) || other.sshUrl == sshUrl) &&
(identical(other.svnUrl, svnUrl) || other.svnUrl == svnUrl) &&
(identical(other.gitUrl, gitUrl) || other.gitUrl == gitUrl) &&
(identical(other.homepageUrl, homepageUrl) || other.homepageUrl == homepageUrl) &&
(identical(other.archiveUrl, archiveUrl) || other.archiveUrl == archiveUrl) &&
(identical(other.assigneesUrl, assigneesUrl) || other.assigneesUrl == assigneesUrl) &&
(identical(other.blobsUrl, blobsUrl) || other.blobsUrl == blobsUrl) &&
(identical(other.branchesUrl, branchesUrl) || other.branchesUrl == branchesUrl) &&
(identical(other.collaboratorsUrl, collaboratorsUrl) || other.collaboratorsUrl == collaboratorsUrl) &&
(identical(other.commentsUrl, commentsUrl) || other.commentsUrl == commentsUrl) &&
(identical(other.commitsUrl, commitsUrl) || other.commitsUrl == commitsUrl) &&
(identical(other.compareUrl, compareUrl) || other.compareUrl == compareUrl) &&
(identical(other.contentsUrl, contentsUrl) || other.contentsUrl == contentsUrl) &&
(identical(other.contributorsUrl, contributorsUrl) || other.contributorsUrl == contributorsUrl) &&
(identical(other.deploymentsUrl, deploymentsUrl) || other.deploymentsUrl == deploymentsUrl) &&
(identical(other.downloadsUrl, downloadsUrl) || other.downloadsUrl == downloadsUrl) &&
(identical(other.eventsUrl, eventsUrl) || other.eventsUrl == eventsUrl) &&
(identical(other.forksUrl, forksUrl) || other.forksUrl == forksUrl) &&
(identical(other.gitCommitsUrl, gitCommitsUrl) || other.gitCommitsUrl == gitCommitsUrl) &&
(identical(other.gitRefsUrl, gitRefsUrl) || other.gitRefsUrl == gitRefsUrl) &&
(identical(other.gitTagsUrl, gitTagsUrl) || other.gitTagsUrl == gitTagsUrl) &&
(identical(other.hooksUrl, hooksUrl) || other.hooksUrl == hooksUrl) &&
(identical(other.issueCommentUrl, issueCommentUrl) || other.issueCommentUrl == issueCommentUrl) &&
(identical(other.issueEventsUrl, issueEventsUrl) || other.issueEventsUrl == issueEventsUrl) &&
(identical(other.issuesUrl, issuesUrl) || other.issuesUrl == issuesUrl) &&
(identical(other.keysUrl, keysUrl) || other.keysUrl == keysUrl) &&
(identical(other.labelsUrl, labelsUrl) || other.labelsUrl == labelsUrl) &&
(identical(other.languagesUrl, languagesUrl) || other.languagesUrl == languagesUrl) &&
(identical(other.mergesUrl, mergesUrl) || other.mergesUrl == mergesUrl) &&
(identical(other.milestonesUrl, milestonesUrl) || other.milestonesUrl == milestonesUrl) &&
(identical(other.mirrorUrl, mirrorUrl) || other.mirrorUrl == mirrorUrl) &&
(identical(other.notificationsUrl, notificationsUrl) || other.notificationsUrl == notificationsUrl) &&
(identical(other.pullsUrl, pullsUrl) || other.pullsUrl == pullsUrl) &&
(identical(other.releasesUrl, releasesUrl) || other.releasesUrl == releasesUrl) &&
(identical(other.stargazersUrl, stargazersUrl) || other.stargazersUrl == stargazersUrl) &&
(identical(other.statusesUrl, statusesUrl) || other.statusesUrl == statusesUrl) &&
(identical(other.subscribersUrl, subscribersUrl) || other.subscribersUrl == subscribersUrl) &&
(identical(other.subscriptionUrl, subscriptionUrl) || other.subscriptionUrl == subscriptionUrl) &&
(identical(other.tagsUrl, tagsUrl) || other.tagsUrl == tagsUrl) &&
(identical(other.teamsUrl, teamsUrl) || other.teamsUrl == teamsUrl) &&
(identical(other.treesUrl, treesUrl) || other.treesUrl == treesUrl) &&
(identical(other.templateRepository, templateRepository) || other.templateRepository == templateRepository) &&
(identical(other.starredAt, starredAt) || other.starredAt == starredAt) &&
(identical(other.pushedAt, pushedAt) || other.pushedAt == pushedAt) &&
(identical(other.createdAt, createdAt) || other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) &&
(identical(other.fromServer, fromServer) || other.fromServer == fromServer));
}