isDivisibleBy function
check if the string str
is a number that's divisible by another
n
is a String or an int.
Implementation
bool isDivisibleBy(String str, Object n) {
try {
return double.parse(str) % int.parse(n.toString()) == 0;
} on FormatException {
return false;
}
}