SUniversalHtml class

Cross-platform helpers for common web window/location actions.

On web: delegates to package:web (web.window.location.*). On non-web platforms: all methods are no-ops and currentHref returns ''.

Usage:

import 'package:s_packages/s_universal_html/web_actions.dart';

SUniversalHtml.reloadWindow();
SUniversalHtml.navigateTo('https://example.com');
SUniversalHtml.replaceLocation('https://example.com');
print(SUniversalHtml.currentHref);

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

currentHref String
Returns the current location.href. Returns '' on non-web platforms.
no setter

Static Methods

Navigates to url via location.assign(). No-op on non-web platforms.
reloadWindow() → void
Reloads the current browser window. No-op on non-web platforms.
replaceLocation(String url) → void
Replaces the current history entry with url via location.replace(). No-op on non-web platforms.