isNum function

bool isNum(
  1. Object? value
)

Returns true if value is num. Can be a num as string too.

Implementation

bool isNum(Object? value) {
  if (value == null) return false;
  if (value is num) return true;

  var s = value.toString();
  return num.tryParse(s) != null;
}