PlatformLocation class abstract interface

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()

Properties

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

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 nonexistent 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