英文:
Are we able to hide the query parameter in flutter web while navigating through go_router?
问题
"假设我需要隐藏通过go_router的查询参数发送的一些重要参数,如 -
GoRouter.of(context).pushNamed(route, queryParameters: { 'id': 'hhhhhh', 'key': 'yyyyy' });
我不想让用户看到Id,Flutter中是否有可能实现这一点?
我尝试了dart:convert
中存在的Uri.encodeQueryParameters()函数,但没有成功。"
英文:
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.
答案1
得分: 0
实际上,你无法隐藏这一点,但你可以对其进行加密并在其他页面上进行解密,因此查询参数应该是类似 data = "加密数据",然后你在其他页面上解密它,用户只能看到加密的数据。
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论