Hi, author.
Do i have to override == and hashcode everytime i write state and event files?
If it's possible, could you give us some example for this too?
Thank you.
@Feelthewind the default behavior for == in Dart is to return true if and only if the two objects are the same instance. So for this reason if you ever want to be able to write tests for equality of two events/states or use distinct/debounce in the transform method you will need to override == and hashcode.
https://www.dartlang.org/guides/language/effective-dart/design#do-override-hashcode-if-you-override-
I just created https://pub.dartlang.org/packages/equatable to try to help with this. If you want, give it a try and let me know what you think?
Does that help? Please let me know if you still have questions.
Closing for now. Let me know if you have more questions and I鈥檒l reopen it.
Oh Thank you for updating the login tutorial with equatable. I thought it was tedious to write code to compare objects and equatable seems to be good.
No problem and thanks for bringing this up!