stringEquality method Null safety

bool stringEquality(
  1. String string
)

Implementation

bool stringEquality(String string) {
  final thisRunes = unit.runes.toList();
  final thoseRunes = string.runes.toList();
  if (thisRunes.length != thoseRunes.length) {
    return false;
  } else {
    for (var i = 0; i < thisRunes.length; i++) {
      if (thisRunes[i] != thoseRunes[i]) {
        return false;
      }
    }
    return true;
  }
}