checkNullableInt static method

int? checkNullableInt(
  1. dynamic value,
  2. String fieldName
)

Implementation

static int? checkNullableInt(dynamic value, String fieldName) {
  if (value == null) return null;
  if (value is int) return value;
  throw FormatException("Invalid type for '$fieldName': expected int");
}