endsWithPattern method
checks if string ends with pattern
Implementation
bool endsWithPattern(Pattern exp) {
if (exp is String) {
return endsWith(exp);
}
final matches = exp.allMatches(this);
final last = matches._lastOrNull;
if (last != null) {
return last.end == length;
}
return false;
}