LCOV - code coverage report
Current view: top level - lib/src/models - mdns_info.dart (source / functions) Coverage Total Hit
Test: coverage.lcov Lines: 0.0 % 16 0
Test Date: 2025-08-17 13:02:53 Functions: - 0 0

            Line data    Source code
       1              : import 'package:multicast_dns/multicast_dns.dart';
       2              : 
       3              : class MdnsInfo {
       4            0 :   MdnsInfo({
       5              :     required this.srvResourceRecord,
       6              :     required this.ptrResourceRecord,
       7              :     required this.txtResourceRecord,
       8              :   });
       9              : 
      10              :   /// Also can be called target
      11            0 :   String get mdnsName => srvResourceRecord.name;
      12              : 
      13            0 :   String get mdnsSrvTarget => srvResourceRecord.target;
      14            0 :   int get mdnsPort => srvResourceRecord.port;
      15              : 
      16              :   /// Also can be called bundleId
      17            0 :   String get mdnsDomainName => ptrResourceRecord.domainName;
      18              : 
      19              :   /// Srv record of the dns
      20            0 :   String get mdnsServiceType {
      21            0 :     final List<String> ptrNameSplit = ptrResourceRecord.name.split('.');
      22              :     String tempString = '';
      23            0 :     if (ptrNameSplit.isNotEmpty) {
      24            0 :       tempString = ptrNameSplit[0];
      25              :     }
      26            0 :     if (ptrNameSplit.length >= 2) {
      27            0 :       tempString = '$tempString.${ptrNameSplit[1]}';
      28              :     }
      29              : 
      30              :     return tempString;
      31              :   }
      32              : 
      33            0 :   String get textRecord => txtResourceRecord.text;
      34              : 
      35              :   SrvResourceRecord srvResourceRecord;
      36              : 
      37              :   PtrResourceRecord ptrResourceRecord;
      38              : 
      39              :   TxtResourceRecord txtResourceRecord;
      40              : 
      41              :   /// mDNS name without the ._tcp.local
      42            0 :   String getOnlyTheStartOfMdnsName() {
      43            0 :     if (mdnsName.contains('.')) {
      44            0 :       return mdnsName.substring(0, mdnsName.indexOf('.'));
      45              :     }
      46            0 :     return mdnsName;
      47              :   }
      48              : }
        

Generated by: LCOV version 2.0-1