convertInt function

int? convertInt(
  1. dynamic src
)

Implementation

int? convertInt(var src) {
  if (src == null) return null;
  if (src is int) return src;
  if (src is String) return int.parse(src);
  throw Exception("Not integer");
}