describeMatch method

  1. @override
String describeMatch(
  1. Plurality plurality
)
override

Describes zero, one, or more candidates that match the requirements of a finder.

The description returned should be a brief English phrase describing a matching candidate with the proper plural form. As an example for a string finder that is looking for strings starting with "hello":

String describeMatch(Plurality plurality) {
  return switch (plurality) {
    Plurality.zero || Plurality.many => 'strings starting with "hello"',
    Plurality.one => 'string starting with "hello"',
  };
}

This will be used both to describe a finder and the results of searching with that finder.

See also:

Implementation

@override
String describeMatch(Plurality plurality) {
  return switch (plurality) {
    Plurality.zero || Plurality.many => 'widgets with $description',
    Plurality.one => 'widget with $description',
  };
}