URI constructor

URI(
  1. String? scheme,
  2. String? user,
  3. String? host, [
  4. int? port,
  5. Map? parameters,
  6. Map? headers,
])

Implementation

URI(String? scheme, this.user, String? host,
    [int? port,
    Map<dynamic, dynamic>? parameters,
    Map<dynamic, dynamic>? headers]) {
  // Checks.
  if (host == null) {
    throw AssertionError('missing or invalid "host" parameter');
  }
  _scheme = scheme ?? DartSIP_C.SIP;
  _host = host.toLowerCase();
  _port = port;

  if (parameters != null) {
    parameters.forEach((dynamic param, dynamic value) {
      setParam(param, value);
    });
  }
  if (headers != null) {
    headers.forEach((dynamic header, dynamic value) {
      setHeader(header, value);
    });
  }
}