hashCode property

  1. @override
int hashCode
override
  1. If two objects are equal according to the equals method, then hashcode of both must be the same. Since spent events are all equal, they should produce the same hashcode.
  2. If two objects are NOT equal, hashcode may be the same or not, but it's better when they are not the same. However, events are mutable, and this could mean the hashcode of the state could be changed when an event is consumed. To avoid this, we make events always return the same hashCode.

Implementation

@override
int get hashCode => 0;