dart-lang / collection

The collection package for Dart contains a number of separate libraries with utility functions and classes that makes working with collections easier.

Home Page:https://pub.dev/packages/collection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an example

mleonhard opened this issue · comments

How about adding an example of how to use the equality checker classes?

final bool contentsEqual = (const ListEquality<Type>()).equals(list1, list2);
@override
bool operator ==(Object other) =>
  (other is MyClass) &&
  foo == other.foo &&
  (const ListEquality<Bar>()).equals(bars, other.bars);

I really had to come to this page to understand how to use this function...

Still lacks a decent example in 2021

Still trying to figure out how to use this package. Cannot seem to get it to work, even with the example above and looking at the tests. 2 matching lists are shown as not matching... Time to just do it manually