dart - How do I get query parameters in the URL -
I am working on a web game in Dart. In this I need a function where I can get data from the URL, in the same way that you will get it in PHP. How do i do this
For example, when I load my web game: ? Id = 15 & randomNumber = 3.14
, for example, add the following to your URL. How can I get them into a raw string (favorite) in Dart or any other format?
You can use ur class from dart: core
I.e.:
main () {print (URI.base.toString ()); // http: // localhost: 8082 / game.html? Id = 15 & randomNumber = 3.14 print (Uri.base.query); // id = 15 & randomNumber = 3.14 print (Uri.base.queryParameters ['randomNumber']); // 3.14}
Comments
Post a Comment