getPath method

  1. @override
String getPath()
override

Returns the active path in the browser.

Implementation

@override
String getPath() {
  final String? hash = includeHash ? _platformLocation.hash : null;
  final String path = _platformLocation.pathname + _platformLocation.search + (hash ?? '');
  if (_basePath.isNotEmpty && path.startsWith(_basePath)) {
    return ensureLeadingSlash(path.substring(_basePath.length));
  }
  return ensureLeadingSlash(path);
}