positiveOrZero static method

FormeValidator positiveOrZero({
  1. String errorText = '',
})

when valid

  1. value is null
  2. value >= 0

Implementation

static FormeValidator positiveOrZero({String errorText = ''}) {
  return (f, dynamic v) {
    if (v == null) {
      return null;
    }
    return v as num >= 0 ? null : errorText;
  };
}