Skip to content

Instantly share code, notes, and snippets.

@niku
Last active March 13, 2020 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niku/793a23a3e69d98014b67785e288e4a7d to your computer and use it in GitHub Desktop.
Save niku/793a23a3e69d98014b67785e288e4a7d to your computer and use it in GitHub Desktop.
{
"make equality properly": {
"prefix": "eq",
"body": [
"@override",
"bool operator ==(Object other) =>",
" identical(this, other) ||",
" other is $1 &&",
" runtimeType == other.runtimeType${2/ ([^ ]+)/ && ${1} == other.${1}/g};",
"",
"@override",
"int get hashCode =>${2/ ([^ ]+)/ ${1}.hashCode ^/g}$0;"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment