checkMax static method

int? checkMax(
  1. dynamic value
)

Implementation

static int? checkMax(dynamic value) {
  if (value == null) return null;
  if (value is int) return value;
  if (value is String) return int.tryParse(value);
  throw const FormatException("Invalid type for 'max': expected int or parsable String");
}