isIgnored function

bool isIgnored(
  1. String s, {
  2. String? key,
})

Ignoring logic

Implementation

bool isIgnored(String s, {String? key}) {
  s = s.trim();

  if (s.isEmpty) return true;
  if (s.startsWith("http")) return true;
  if (RegExp(r'^\d+$').hasMatch(s)) return true;
  if (!RegExp(r'[A-Za-z]').hasMatch(s)) return true;
  if (s.length < 2) return true;
  if (key != null && key == s) return true;

  return false;
}