getPortNumber static method
check if the string is a port number
Implementation
static int? getPortNumber(String value) {
int? port = int.tryParse(value, radix: 10);
if (port == null || port < 0 || port > 65535) {
return null;
}
return port;
}