flutter how to test if caracter is number code example
Example 1: flutter check if string is number dart
bool isNumeric(String s) {
if (s == null) {
return false;
}
return double.tryParse(s) != null;
}
Example 2: check only digits in dart
bool isNumeric(String s) {
if (s == null) {
return false;
}
return double.tryParse(s) != null;
}