updateUriWithDirectConnect function

Uri updateUriWithDirectConnect(
  1. Uri currentUri,
  2. Map<String, dynamic> capabilities
)

Return new URI which has been applied directXxxxx

Implementation

Uri updateUriWithDirectConnect(
    Uri currentUri, Map<String, dynamic> capabilities) {
  final protocol = 'directConnectProtocol';
  final host = 'directConnectHost';
  final port = 'directConnectPort';
  final path = 'directConnectPath';

  if (capabilities.containsKey(protocol) &&
      capabilities.containsKey(host) &&
      capabilities.containsKey(port) &&
      capabilities.containsKey(path)) {
    return Uri.parse(
        '${capabilities[protocol]}://${capabilities[host]}:${capabilities[port]}${capabilities[path]}');
  }

  return currentUri;
}