min function

String min (
  1. num fieldValue,
  2. int minVal,
  3. {String message}
)

Validates that fieldValue (int or double) is equal to or larger than minVal.

Returns null if fieldValue >= minVal else an error message

Implementation

String min(
  num fieldValue,
  int minVal, {
  String message,
}) {
  if ((fieldValue == null) || (fieldValue >= minVal)) {
    return null;
  }
  return message ?? 'Please enter a value greater or equal to $minVal';
}