Closed noamraph closed 2 years ago
List<Object?> is only necessary if one or more props are nullable. Closing for now since the README is accurate as is.
@felangel First of all I wish to thank you - using Equatable in my code really helped me!
I can say that my experience wasn't smooth - since I have nullable fields, it didn't compile, and I had to dig a bit to find out that the actual overridden property uses List<Object?>
so it should be OK to change the type.
If it doesn't affect performance, I still think it would help some users if the examples used Object?
. If it does (or if you don't want to measure it), perhaps add a short note about it?
Anyway, again, thanks a lot for your work!
Noam
Would be helpful if the example mentioned different override to use when you have nullable types.
I tried to add Equatable to a class I have according to the readme, and it failed because I had a nullable field. Replacing
List<Object>
withList<Object?>
fixed the problem. So I suggest to change the readme.The actual overridden property is indeed
List<Object?> get props
, so I think there's no need to restrict it to non-nullable values.Status
READY/IN DEVELOPMENT/HOLD
Breaking Changes
YES | NO
Description
A few sentences describing the overall goals of the pull request's commits.
Related PRs
List related PRs against other branches:
Todos
Steps to Test or Reproduce
Outline the steps to test or reproduce the PR here.
Impact to Remaining Code Base
This PR will affect: