diff --git a/CHANGELOG.md b/CHANGELOG.md index 84633ca..86db242 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.0.8 * MeasureDisplay without notes skips NotePositioning and renders chart without any notes +* Note equality overrides ## 0.0.7 diff --git a/lib/note.dart b/lib/note.dart index ceb0955..c1bfb6a 100644 --- a/lib/note.dart +++ b/lib/note.dart @@ -173,6 +173,17 @@ class Note { Timing sustainReleaseTiming() { return timing + (length ?? Timing(timing.type, timing.nth + 1)); } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Note && + runtimeType == other.runtimeType && + string == other.string && + timing == other.timing; + + @override + int get hashCode => string.hashCode ^ timing.hashCode; } class ChordNoteSet {