concept custom matcher in category dart
appears as: custom matcher, custom matchers

This is an excerpt from Manning's book Dart in Action.
Creating a custom matcher is a matter of extending the provided BaseMatcher class. We’ll look more at extending classes in chapters 6 and 7, but to extend the base matcher, you can create a class that provides two functions: a matches() function and a describe() function. The matches() function returns a bool value depending on whether the expectation was matched. The following listing shows a custom matcher class that validates whether two different PackItems contain the equivalent itemText value.