matchesWildcard static method

bool matchesWildcard(
  1. String value,
  2. String pattern
)

* → any chars; case-insensitive. Exposed for tests.

Implementation

static bool matchesWildcard(String value, String pattern) {
  final escaped = RegExp.escape(pattern).replaceAll(r'\*', '.*');
  return RegExp('^$escaped\$', caseSensitive: false).hasMatch(value);
}