简体   繁体   English

为什么 flutter 在导航弹出后重新加载页面

[英]Why flutter reload page after navigation pop

ProfileView: enter image description here Sorry for my English. ProfileView:在此处输入图像描述对不起我的英语。 I recently started to study flutter and the following question appeared: I have a ProfileView page, this page has subscribers and subscriptions buttons, when you click on the button, you go to the list of users, then after clicking on any of the users, you go to the ProfileView page of this user... if I go back, the first profile view page is reloaded and the ProfileView page of the last open user is shown.我最近开始研究flutter,出现了以下问题:我有一个ProfileView页面,这个页面有订阅者和订阅按钮,当你点击按钮时,你go到用户列表,然后点击任意一个用户后,你 go 到这个用户的 ProfileView 页面... how to keep everything on the stack?如何将所有内容保存在堆栈中?

this is Followers View: enter image description here这是关注者视图:在此处输入图像描述

I had a similar issue with navigation between screens in flutter especially when you download the screen's data from a server you will have to download them every time you go to that specific screen which is not really smooth and fast and there are other problems in navigation, I have used for these issues a dart file in which I have created global variables to (lists, maps, stings...) to save in these variables the data downloaded in each screen and then use them again, you can use these for saving the screen states of any kind of information.我在 flutter 中的屏幕之间导航时遇到了类似的问题,尤其是当您从服务器下载屏幕数据时,您每次将 go 下载到该特定屏幕时都必须下载它们,该特定屏幕不是非常流畅和快速,并且导航中还有其他问题,我已经为这些问题使用了 dart 文件,在该文件中我创建了全局变量(列表、地图、stings ......)以将在每个屏幕中下载的数据保存在这些变量中,然后再次使用它们,您可以使用这些来保存任何信息的屏幕状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM