NumberValidator constructor

const NumberValidator({
  1. bool allowNull = false,
  2. int allowedDecimals = 0,
  3. bool allowNegatives = true,
})

Creates a new NumberValidator instance to validate strings representing numbers.

allowNull (optional): Whether the validator allows null values. allowedDecimals (optional): The allowed number of decimal places. Defaults to 0. allowNegatives (optional): Whether to allow negative numbers. Defaults to true.

Implementation

const NumberValidator({
  this.allowNull = false,
  this.allowedDecimals = 0,
  this.allowNegatives = true,
}) : super();