isNumber function

bool isNumber(
  1. dynamic s
)

Implementation

bool isNumber(dynamic s) {
  if (s is num) {
    return true;
  }
  if (s is String) {
    return double.tryParse(s.trim()) != null;
  }
  return false;
}