https://github.com/xclud/window_location_href
window.location.href, similar to js, for flutter (all platforms)
https://github.com/xclud/window_location_href
flutter href web
Last synced: over 1 year ago
JSON representation
window.location.href, similar to js, for flutter (all platforms)
- Host: GitHub
- URL: https://github.com/xclud/window_location_href
- Owner: xclud
- License: mit
- Created: 2019-12-22T08:33:07.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-10-24T20:06:12.000Z (over 3 years ago)
- Last Synced: 2025-01-09T05:17:19.944Z (over 1 year ago)
- Topics: flutter, href, web
- Language: Dart
- Homepage: https://pub.dev/packages/window_location_href
- Size: 102 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pub.dartlang.org/packages/window_location_href)
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:
``` dart
dependencies:
window_location_href: any
```
Then, in your code:
``` dart
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.