numericRegex top-level property
Regex to check a string contains only digits Note that spaces are not counted as numeric
For example:
numericRegex.hasMatch('402')->truenumericRegex.hasMatch('203k')->falsenumericRegex.hasMatch('201.6')->true
Implementation
final numericRegex = RegExp(r'^[\d.]+$');