window_location_href 1.0.1+2 window_location_href: ^1.0.1+2 copied to clipboard
Cross-platfrom window.location.href. Supports all platforms and is easy.
A cross-platfrom implementation of window.location.href
& window.navigator.userAgent
.
Supported platforms #
- Flutter Android
- Flutter iOS
- Flutter Web
- Flutter Desktop
Getting Started #
In your pubspec.yaml
file add:
dependencies:
window_location_href: any
Then, in your code:
import 'window_location_href/window_location_href.dart';
final location = href;
Above code returns current page url on web (window.location.href
), and null
on other platforms.