PathUrlStrategy constructor Null safety

PathUrlStrategy(
  1. [PlatformLocation _platformLocation = const BrowserPlatformLocation()]
)

Creates an instance of PathUrlStrategy.

The PlatformLocation parameter is useful for testing to mock out browser interactions.

Implementation

PathUrlStrategy([
  PlatformLocation _platformLocation = const BrowserPlatformLocation(),
])  : _basePath = stripTrailingSlash(extractPathname(checkBaseHref(
        _platformLocation.getBaseHref(),
      ))),
      super(_platformLocation);