isInvalidValue static method

bool isInvalidValue(
  1. dynamic val, {
  2. bool shouldNotZero = false,
})

Implementation

static bool isInvalidValue(dynamic val, {bool shouldNotZero = false}) {
  final actualValue = num.tryParse(val.toString()) ?? 0;
  bool isZero = false;
  if (shouldNotZero) isZero = actualValue == 0 || !actualValue.isFinite;
  return (val.toString() == '.') || isZero;
}