felangel / equatable

A Dart package that helps to implement value based equality without needing to explicitly override == and hashCode.
https://pub.dev/packages/equatable
MIT License
901 stars 100 forks source link

`Equatable` is redundant with `EquatableMixin` #160

Closed shilangyu closed 1 month ago

shilangyu commented 1 year ago

Is your feature request related to a problem? Please describe.

When choosing which one to use (Equatable or EquatableMixin) there is no benefit of choosing Equatable (or I am failing to see one) over the mixin version. This duplicates the API for no clear reason to me.

Describe the solution you'd like

Removing the non-mixin version. This simplifies this package, docs, and usage.

Additional context

During code reviews I often have to tell people to use the mixin version instead, since it is more extensible (for example will allow in the future to extend some other class).

If I am missing some advantage that the class version has, please let me know what that is and feel free to close this issue.

utamori commented 1 year ago

I think this can be solved by making Equatable an Dart3 abstract mixin class. EquatableMixin should be deprecated and removed later.

161

felangel commented 1 month ago

Closing this since it will be resolved by #175