isDigit function
Checks whether the given string is a single digit from 0 to 9.
Implementation
bool isDigit(final String char) {
if (char.length != 1) {
return false;
}
final int code = char.codeUnitAt(0);
return code >= _digit0 && code <= _digit9;
}