Skip to content

Instantly share code, notes, and snippets.

@Nash0x7E2
Created September 27, 2018 00:11
Show Gist options
  • Save Nash0x7E2/09deba2ecebb8be7b45304282668d17d to your computer and use it in GitHub Desktop.
Save Nash0x7E2/09deba2ecebb8be7b45304282668d17d to your computer and use it in GitHub Desktop.
class UserModel {
UserModel({this.firstName, this.lastName, this.profileImageUrl});
String firstName;
String lastName;
String profileImageUrl;
//New
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is UserModel &&
runtimeType == other.runtimeType &&
firstName == other.firstName &&
lastName == other.lastName &&
profileImageUrl == other.profileImageUrl;
//New
@override
int get hashCode =>
firstName.hashCode ^ lastName.hashCode ^ profileImageUrl.hashCode;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment