extractPath static method

String? extractPath(
  1. String url
)

Extracts path from URL

Example:

UrlUtils.extractPath('https://example.com/path/to/page'); // '/path/to/page'

Implementation

static String? extractPath(String url) {
  final uri = parse(url);
  return uri?.path;
}