验证端口号
static bool isPort(String? port) { if (port?.isEmpty ?? true) return false; final num = int.tryParse(port!); return num != null && num >= 1 && num <= 65535; }