Check out example codes for "dart test matcher expecting a field value". It will help you in understanding the concepts better.

Code Example 1

var hasCorrectArea = predicate((rect) => rect.area == rect.length * rect.width,
    "has correct area");

expect(myRect, hasCorrectArea);

Learn ReactJs, React Native from akashmittal.com