url property

String get url

Implementation

String get url {
  String path = _paths
      .map((ps) => ps.startsWith(':') ? _pathParams[ps.substring(1)] : ps)
      .join('/');

  path = Uri.encodeFull(path);

  if (_origin == null && getQuery.isEmpty) {
    return path;
  }

  final sb = StringBuffer();
  if (_origin != null) {
    sb.write(_origin);
  }
  if (_origin == null || !_origin!.endsWith('/')) {
    sb.write('/');
  }
  sb.write(path);
  if (getQuery.isEmpty) {
    return sb.toString();
  }
  _makeQueryParams(sb, getQuery);
  return sb.toString();
}