PlatformLocation class Null safety

Encapsulates all calls to DOM apis, which allows the UrlStrategy classes to be platform agnostic and testable.

For convenience, the PlatformLocation class can be used by implementations of UrlStrategy to interact with DOM apis like pushState, popState, etc.

Implementers

Constructors

PlatformLocation()
Abstract const constructor. This constructor enables subclasses to provide const constructors so that they can be used in const expressions.
const

Properties

hash String
The hash part of the URL in the browser address bar.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
pathname String
The pathname part of the URL in the browser address bar.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
The query part of the URL in the browser address bar.
read-only
state Object?
The state in the current history entry.
read-only

Methods

addPopStateListener(EventListener fn) → void
Registers an event listener for the popstate event.
getBaseHref() String?
The base href where the Flutter app is being served.
go(int count) → void
Moves forwards or backwards through the history stack.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
pushState(Object? state, String title, String url) → void
Adds a new entry to the browser history stack.
removePopStateListener(EventListener fn) → void
Unregisters the given listener (added by addPopStateListener) from the popstate event.
replaceState(Object? state, String title, String url) → void
Replaces the current entry in the browser history stack.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited