isNumber static method

bool isNumber(
  1. dynamic s
)

Returns true if a String/Value is numeric

Implementation

static bool isNumber(dynamic s) {
  try {
    if (s is double) return true;
    double.parse(s.toString());
    return true;
  } catch (e) {
    return false;
  }
}