endsWithAny static method

bool endsWithAny(
  1. String text,
  2. List<String> suffixes
)

Check if string ends with any of the given suffixes

text - The text to check suffixes - List of suffixes to check Returns true if text ends with any suffix

Implementation

static bool endsWithAny(String text, List<String> suffixes) {
  return suffixes.any((suffix) => text.endsWith(suffix));
}