maxValue static method
Implementation
static FormFieldValidator<String> maxValue(
{double? maxValue, String? message}) {
return (fieldValue) {
if (fieldValue!.trim().isEmpty)
return message ?? "Field must be lesser than $maxValue";
double dFieldValue = double.parse(fieldValue
.replaceAll(" ", "")
.replaceAll(",", "")
.replaceAll(".", ""));
if (Validator.maxValue(dFieldValue, maxValue!)) {
return null;
} else {
return message ?? "Field must be lesser than $maxValue";
}
};
}