errorText method

String? errorText({
  1. double? value,
})

Implementation

String? errorText({double? value}) {
  value ??= this.value;
  if (value == null) {
    return widget.isRequired ? "Value is required" : null;
  }

  if (_minimum != null && value < _minimum!) {
    return "Value must be greater than or equal to $_minimum";
  }
  if (_maximum != null && value > _maximum!) {
    return "Value must be less than or equal to $_maximum";
  }
  return null;
}