equals method
Equals is a similar function that use Java or Kotlin classes to see the equality from two objects
Implementation
bool equals(
String other, {
bool caseSensitive = true,
Pattern? pattern,
bool useThisInstead = false,
}) {
if (!caseSensitive) return toLowerCase() == other.toLowerCase();
return pattern != null
? pattern is RegExp
? pattern.hasMatch(useThisInstead ? this : other)
: pattern.allMatches(useThisInstead ? this : other).isNotEmpty
: this == other;
}