matches method

bool matches(
  1. String key
)

Returns true if the immediate key is sensitive.

Implementation

bool matches(String key) {
  final k = key.toLowerCase().trim();
  if (keys.contains(k)) return true;
  // also treat underscores/dashes variants as equal
  final normalized = k.replaceAll(RegExp(r'[-_\s]'), '');
  return keys.contains(normalized);
}