diff --git a/nsd_platform_interface/lib/src/serialization.dart b/nsd_platform_interface/lib/src/serialization.dart index 7ffc6eb..c2c6fc6 100644 --- a/nsd_platform_interface/lib/src/serialization.dart +++ b/nsd_platform_interface/lib/src/serialization.dart @@ -53,20 +53,28 @@ Service? deserializeService(dynamic arguments) { final host = data['service.host'] as String?; final port = data['service.port'] as int?; final addresses = data['service.addresses'] as String?; - final txt = data['service.txt'] != null ? Map.from(data['service.txt']) : null; - - if (name == null && - type == null && - host == null && - port == null && - addresses == null && + final txt = data['service.txt'] != null + ? Map.from(data['service.txt']) + : null; + + if (name == null && + type == null && + host == null && + port == null && + addresses == null && txt == null) { return null; } final inetAddresses = addresses != null ? [InternetAddress(addresses)] : null; - return Service(name: name, type: type, host: host, port: port, addresses: inetAddresses, txt: txt); + return Service( + name: name, + type: type, + host: host, + port: port, + addresses: inetAddresses, + txt: txt); } Map serializeHandle(String value) => {