moo*_*der 6 dart flutter inherited-widget
在将InheritedWidget添加到应用程序后,我认识到当我使用Pop()从详细信息屏幕返回列表时,ListView失去了滚动位置(选定的项目索引)。
我知道小部件可以随时重建,但也许有人可以提出解决方案,而无需手动处理缓存。
在实现InheritedWidget之前,PS Scroll位置很好
没有任何代码,所以在黑暗中一炮而红
尝试像这样添加“键”
ListView(
key: const PageStorageKey<String>('some unique text'),
//other parameters
);
Run Code Online (Sandbox Code Playgroud)