LocalService class
A service discovered on the local network.
Constructors
-
LocalService({required String id, required String instanceName, required String serviceType, required String domain, String? hostname, List<
InternetAddressValue> addresses = const <InternetAddressValue>[], int? port, LocalTransportProtocol transport = LocalTransportProtocol.tcp, Map<String, Uint8List> rawTxtRecords = const <String, Uint8List>{}, Map<String, String> textTxtRecords = const <String, String>{}, Set<LocalDiscoveryProtocol> discoveredBy = const <LocalDiscoveryProtocol>{}, DateTime? firstSeenAt, DateTime? lastSeenAt, Duration? ttl, bool resolved = false, Uri? location, Map<String, Object?> metadata = const <String, Object?>{}}) -
const
-
LocalService.fromJson(Map<
String, Object?> json) -
Creates a LocalService from a JSON-compatible map.
factory
Properties
-
addresses
→ List<
InternetAddressValue> -
The resolved addresses of this service.
final
-
discoveredBy
→ Set<
LocalDiscoveryProtocol> -
The protocols that discovered this service.
final
- domain → String
-
The domain in which the service was discovered (e.g.,
local.).final - firstSeenAt → DateTime?
-
When this service was first seen.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- hostname → String?
-
The hostname of the device providing this service.
final
- id → String
-
A stable identifier for this service.
final
- instanceName → String
-
The instance name of the service (e.g.,
My Printer).final - lastSeenAt → DateTime?
-
When this service was last seen.
final
- location → Uri?
-
The location URL (e.g., UPnP description URL).
final
-
metadata
→ Map<
String, Object?> -
Additional metadata about this service.
final
- port → int?
-
The port on which the service is available.
final
-
rawTxtRecords
→ Map<
String, Uint8List> -
Raw TXT record values, preserving original bytes.
final
- resolved → bool
-
Whether this service has been resolved.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceType → String
-
The service type (e.g.,
_ipp._tcp).final -
textTxtRecords
→ Map<
String, String> -
Decoded text TXT record values.
final
- transport → LocalTransportProtocol
-
The transport protocol used by this service.
final
- ttl → Duration?
-
The advertised TTL of this service.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rawTxt(
String key) → Uint8List? -
Returns the raw bytes of a TXT record key, or
nullif not present. -
toJson(
) → Map< String, Object?> - Converts this service to a JSON-compatible map.
-
toString(
) → String -
A string representation of this object.
override
-
txt(
String key) → String? -
Returns the decoded value of a TXT record key, or
nullif not present.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override