官方推荐方法:

AutomaticKeepAliveClientMixin,同时实现wantKeepAlive方法。

class _MsgLisViewState extends State<MsgListView> with AutomaticKeepAliveClientMixin {
...
@override bool get wantKeepAlive
=> true; // 需要实现这个方法,返回true则会保持状态 ... }

 


作者:yuanzhiying

相关文章:

  • 2021-09-14
  • 2022-12-23
  • 2021-10-17
  • 2021-06-04
  • 2021-04-08
  • 2022-12-23
  • 2022-02-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-13
  • 2021-08-19
  • 2021-10-12
  • 2022-12-23
  • 2021-12-12
  • 2021-12-19
相关资源
相似解决方案