isNum static method

bool isNum(
  1. String str
)

【全为数字】返回true

Implementation

static bool isNum(String str) {
  return RegExp(r'^-?[0-9]+(\.[0-9]+)?$').hasMatch(str);
}