url method

String url({
  1. String? path,
})

Implementation

String url({String? path}) {
  if (uri.port == 80 && uri.scheme.toLowerCase() == "https") {
    return uri.replace(port: 443, path: path).toString();
  }

  /// When the path is a full url
  if (path != null && path.startsWith('http')) {
    return path;
  }

  return uri.replace(path: path).toString();
}