genericDoubleValidator static method

String? genericDoubleValidator(
  1. String? value,
  2. String type
)

Implementation

static String? genericDoubleValidator(String? value, String type) {
  if (value == null || value.isEmpty || double.parse(value) <= 0) {
    return "$type cannot be empty or 0";
  }
  return null;
}