We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Equatable doesn't work with class that override iterator like so:
iterator
To Reproduce
class SomeObject with EquatableMixin { final CustomList list; const SomeObject(this.list); @override List<Object> get props => [list]; } class CustomList extends Iterable<String> with EquatableMixin { final bool flag; final List<String> list; const CustomList({this.list, this.flag}); @override List<Object> get props => [flag, list]; @override Iterator<String> get iterator => list.iterator; }
const list1 = CustomList(list: ['1', '2'], flag: true); const list2 = CustomList(list: ['1', '2'], flag: false); print(const SomeObject(list1) == const SomeObject(list2)); // true
Additional context As a partial solution, if the object inherits from the Equatable, then compare via ==
Equatable
==
The text was updated successfully, but these errors were encountered:
felangel
Successfully merging a pull request may close this issue.
Describe the bug
Equatable doesn't work with class that override
iterator
like so:To Reproduce
Additional context
As a partial solution, if the object inherits from the
Equatable
, then compare via==
The text was updated successfully, but these errors were encountered: