urlStrategy top-level property

UrlStrategy? urlStrategy

Returns the present UrlStrategy for handling the browser URL.

Returns null when the browser integration has been manually disabled.


UrlStrategy? get urlStrategy =>
    isCustomUrlStrategySet ? _customUrlStrategy : _defaultUrlStrategy;
void urlStrategy=(UrlStrategy? strategy)

Sets a custom URL strategy instead of the default one.

Passing null disables browser history integration altogether.

This setter can only be called once. Subsequent calls will throw an error in debug mode.


set urlStrategy(UrlStrategy? strategy) {
    'Cannot set URL strategy a second time or after the app has been initialized.',
  isCustomUrlStrategySet = true;
  _customUrlStrategy = strategy;