Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get current URL in Flutter Web App

How can I get the current URL in a Flutter Web App on which the user of the web app currently is?

For example:

app1.website.com app2.website.com

According to the result of the current URL on which the user of the web app currently is, I want to show different content.

like image 553
TheUniqueProgrammer Avatar asked May 17 '19 13:05

TheUniqueProgrammer


People also ask

How do I assign a URL in Flutter?

Show activity on this post. And also change the url from "localhost:49318/#/home/inicio" to "localhost:49318/#/home/other". All of this without using the Navigator. In a mobile app I would change the widget shown with a set state, but doing that on a web page wouldn't change the url.


1 Answers

You can find it like this:

import 'dart:html';

var url = window.location.href;
like image 68
coldandtired Avatar answered Sep 29 '22 18:09

coldandtired