Skip to content

Commit 94f0e34

Browse files
author
Kamil Klyta
committed
Implement equality operator for indicator state change class
1 parent 2c6328e commit 94f0e34

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/src/data/indicator_state_change.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ class IndicatorStateChange {
2121
return currentState == from && newState == to;
2222
}
2323

24+
@override
25+
bool operator ==(Object other) =>
26+
other.runtimeType == runtimeType &&
27+
other is IndicatorStateChange &&
28+
other.currentState == currentState &&
29+
other.newState == newState;
30+
31+
@override
32+
int get hashCode => Object.hash(currentState, newState);
33+
2434
@override
2535
String toString() =>
2636
"$runtimeType(${describeEnum(currentState)} → ${describeEnum(newState)})";

0 commit comments

Comments
 (0)