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.
https://pub.dev/packages/collection
BSD 3-Clause "New" or "Revised" License
373 stars 87 forks source link

Add an example #107

Open mleonhard opened 5 years ago

mleonhard commented 5 years ago

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);
WalterLievens commented 3 years ago

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

sgehrman commented 2 years ago

Still lacks a decent example in 2021

jpSimkins commented 2 years ago

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