by @kodeazy
flutter check given number is prime or not in dart file?
 A prime number is a number that is divided by 1 and itself.

Below is an example program on prime number.
void main() { int num = 12; for (int index = 2; index <= num / 2; ++index) { if (num % index == 0) { print("given number is not prime"); return; } } print("given number is a prime"); return; }
12 is divisible by 1,2,3,4,6. so it is not a prime number.

Output
:given number is not prime