matchesSearch method

bool matchesSearch(
  1. String str
)

does it match while searching for given string

Implementation

bool matchesSearch(String str) {
  str = str.trim().toLowerCase();
  String d = displayName != null ? displayName!.toLowerCase() : "";
  String n = name != null ? name!.toLowerCase() : "";
  String str2 = " $str";
  return d.startsWith(str) ||
      d.contains(str2) ||
      n.startsWith(str) ||
      n.contains(str2);
}