isInt static method

bool isInt(
  1. String str
)

Check if the string str is an integer

Implementation

static bool isInt(String str) {
  RegExp _int = new RegExp(r'^(?:-?(?:0|[1-9][0-9]*))$');
  return _int.hasMatch(str);
}