maxValue static method

String? maxValue(
  1. String? value,
  2. num max, {
  3. String? message,
})

Implementation

static String? maxValue(String? value, num max,
    {String? message}) {
  final v = num.tryParse(value ?? '');
  if (v == null) return null;

  if (v > max) {
    return message ?? "Maximum value is $max";
  }
  return null;
}