Skip to content

Commit

Permalink
platform: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianhaberey committed Nov 18, 2024
1 parent 229831b commit 04c651b
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions nsd_platform_interface/lib/src/serialization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Uint8List?>.from(data['service.txt']) : null;

if (name == null &&
type == null &&
host == null &&
port == null &&
addresses == null &&
final txt = data['service.txt'] != null
? Map<String, Uint8List?>.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<String, dynamic> serializeHandle(String value) => {
Expand Down

0 comments on commit 04c651b

Please sign in to comment.