matches method

bool matches(
  1. String? value,
  2. String text,
  3. bool isRegex
)

Implementation

bool matches(String? value, String text, bool isRegex) {
  if (value == null) {
    return false;
  }
  return isRegex
      ? RegExp(text).hasMatch(value)
      : value.toLowerCase().contains(text.toLowerCase());
}