getService method

Future<Service?> getService(
  1. String type
)

Returns the service of the specified type or null if this device does not support this service

Implementation

Future<Service?> getService(String type) async {
  try {
    final service = services.firstWhere(
      (it) => it.type == type || it.id == type,
    );
    return await service.getService(this);
  } catch (e) {
    return null;
  }
}