getMinMaxMessage static method

String? getMinMaxMessage({
  1. String? minMessage,
  2. String? maxMessage,
  3. String? nullMessage,
  4. required int? value,
  5. required int min,
  6. required int max,
})

Implementation

static String? getMinMaxMessage(
    {String? minMessage,
    String? maxMessage,
    String? nullMessage,
    required int? value,
    required int min,
    required int max}) {
  if (value == null) {
    return nullMessage;
  }
  if (value < min) {
    return minMessage;
  } else if (value > max) {
    return maxMessage;
  }
  return null;
}