how to check string contains only integer in dart 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;
}