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