extractPathname function

String extractPathname(
  1. String url
)

Extracts the pathname part of a full url.

Example: for the url http://example.com/foo, the extracted pathname will be /foo.

Implementation

String extractPathname(String url) {
  return ensureLeadingSlash(Uri.parse(url).path);
}