hasServiceType function

Matcher hasServiceType(
  1. String serviceType
)

Custom matcher to verify if a LocalDevice advertises a given service type.

Implementation

Matcher hasServiceType(String serviceType) {
  return predicate<LocalDevice>(
    (device) => device.services.any((s) => s.serviceType == serviceType),
    'advertises service type "$serviceType"',
  );
}