isNumeric method

bool isNumeric(
  1. String s
)

Implementation

bool isNumeric(String s) {
  bool hasil = true;
  if (s == null) {
    return false;
  }
  var coba1 = double.tryParse(s);
  if (coba1 == null) {
    hasil = false;
  } else {
    var coba2 = int.tryParse(s);
    if (coba2 == null) {
      hasil = false;
    }
  }
  return hasil;
}