extractPorts function Null safety
- String portRaw
Implementation
String extractPorts(String portRaw) {
List<String> portsRaw = portRaw.split('\n');
String ports = '';
for (String portRaw in portsRaw) {
if (portRaw.contains(':')) {
if (ports != '') {
ports += ', ';
}
ports += int.tryParse(portRaw.split(':')[2].split(' ')[0], radix: 16)
.toString();
}
}
if (ports.isEmpty) {
ports = "None";
}
return ports;
}