Last active
February 4, 2023 12:39
-
-
Save marcossevilla/d82148fc402ceac1aa679f2d53c80986 to your computer and use it in GitHub Desktop.
Check if text input value is number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool isNumber(String value) { | |
if (value.isEmpty) return false; | |
final numb = num.tryParse(value); | |
return numb == null ? false : true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment