endsWith static method

bool endsWith(
  1. String haystack,
  2. dynamic needles
)

Determines if haystack ends with any of the needles.

Implementation

static bool endsWith(String haystack, dynamic needles) {
  final list = needles is List ? needles : [needles];
  for (final n in list) {
    final s = n.toString();
    if (s.isNotEmpty && haystack.endsWith(s)) return true;
  }
  return false;
}