isPrime property

bool get isPrime

Implementation

bool get isPrime {
  if (this <= 1) return false;
  for (int i = 2; i < this; i++) {
    if (this % i == 0) return false;
  }
  return true;
}