Num.pos constructor

Num.pos({
  1. String? mal,
  2. String? neg,
})

Constrains data to positive numbers (zero included).

mal "malformed", the error message in case of non-numeric input values; the default value is 'not a number'. neg the error message if an input value is negative; the default value is 'it cannot be negative'.

Implementation

Num.pos({String? mal, String? neg})
    : this.min(0, mal: mal, small: neg ?? 'it cannot be negative');