portsAsPair property

List<Pair<int>> get portsAsPair

List of mapped ports as Pair<int>.

Implementation

List<Pair<int>> get portsAsPair => ports.map((e) {
      var parts = e.split(':');
      var p1 = parseInt(parts[0])!;
      var p2 = parts.length > 1 ? (parseInt(parts[1]) ?? p1) : p1;
      return Pair(p1, p2);
    }).toList();