how to use window.location.search

Issue

How to use window.location.search to print url parameters from the dart program
I am not able to understand how to use Uri.

import 'dart:core';
import 'dart:html';

void main(){
 Uri u = new Uri();
 u = 'http://mydomain.com/path/Sandbox.html?paramA=1&parmB=2'; 
 print(window.location.search);
}

Solution

You create an Uri like

Uri u = Uri.parse('http://mydomain.com/path/Sandbox.html?paramA=1&parmB=2');
print(u.query);

I don’t know what kind of session variable your are using therefor I haven’t added something about this.

Answered By – Günter Zöchbauer

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *