Search code examples
flutterflutter-go-router

Are we able to hide the query parameter in flutter web while navigating through go_router?


Assume that I have to hide a few essential parameters which are sent through go_router's query params like - "

GoRouter.of(context).pushNamed(route, queryParameters: { 'id': 'hhhhhh', 'key': 'yyyyy' });

I don't want to let the user see the Id, is that possible in Flutter?

I tried the Uri.encodeQueryParameters() function which is present in dart:convert but it didn't work.


Solution

  • Actually, You can't hide this but You can encrypt this and decrypt it from the other page so the query params should be something like data = "encrypted data" and then you decrypt it from the other page and for the user will see only the encrypted data