Edin
Edin

Reputation: 898

How to receive/fetch url parameter (get request) in flutter web?

I am using a script by exporting it with flutter for the web. There I need to put something over an URL slug into a field via a get request.

Example:

www.url.de/?id=123 

here I need to put "123" into the field.

How can I read this 123 out of the URL with Flutter Web?

Upvotes: 3

Views: 485

Answers (1)

Gioele
Gioele

Reputation: 348

Try Uri.base.queryParameters it returns a Map, so you can do Uri.base.queryParameters['id'] and it will return the value

Upvotes: 4

Related Questions