alibaba / fish-redux

An assembled flutter application framework.
https://github.com/alibaba/fish-redux
Apache License 2.0
7.33k stars 843 forks source link

页面生命周期重复执行两次正常吗? #580

Closed SeptSky closed 4 years ago

SeptSky commented 4 years ago

执行过程如下所示: I/flutter (20422): ---------- [HomePage] ---------- I/flutter (20422): [HomePage] HomeAction.switchTab 2 I/flutter (20422): ========== [HomePage] ================ I/flutter (20422): HomePage Lifecycle.build I/flutter (20422): InfoNavPage Lifecycle.didUpdateWidget I/flutter (20422): InfoNavPage Lifecycle.didUpdateWidget I/flutter (20422): MinePage Lifecycle.didUpdateWidget I/flutter (20422): ---------- [AboutPage] ---------- I/flutter (20422): [AboutPage] _UpdateState.Assign Instance of 'AboutState' I/flutter (20422): ========== [AboutPage] ================ I/flutter (20422): AboutPage Lifecycle.initState I/flutter (20422): ---------- [AboutPage] ---------- I/flutter (20422): [AboutPage] AboutReducer.initAboutReducer [] I/flutter (20422): ========== [AboutPage] ================ I/flutter (20422): AboutPage Lifecycle.didChangeDependencies I/flutter (20422): AboutPage Lifecycle.build I/flutter (20422): AboutPage Lifecycle.build I/flutter (20422): HomePage Lifecycle.deactivate I/flutter (20422): InfoNavPage Lifecycle.deactivate I/flutter (20422): InfoNavPage Lifecycle.deactivate I/flutter (20422): MinePage Lifecycle.deactivate I/flutter (20422): MinePage Lifecycle.didChangeDependencies I/flutter (20422): HomePage Lifecycle.didUpdateWidget I/flutter (20422): InfoNavPage Lifecycle.didUpdateWidget I/flutter (20422): InfoNavPage Lifecycle.didUpdateWidget I/flutter (20422): MinePage Lifecycle.didUpdateWidget I/flutter (20422): HomePage Lifecycle.deactivate I/flutter (20422): InfoNavPage Lifecycle.deactivate I/flutter (20422): InfoNavPage Lifecycle.deactivate I/flutter (20422): MinePage Lifecycle.deactivate I/flutter (20422): HomePage Lifecycle.didUpdateWidget I/flutter (20422): InfoNavPage Lifecycle.didUpdateWidget I/flutter (20422): InfoNavPage Lifecycle.didUpdateWidget I/flutter (20422): MinePage Lifecycle.didUpdateWidget I/flutter (20422): AboutPage Lifecycle.deactivate I/flutter (20422): AboutPage Lifecycle.dispose

出现多次重复执行的情况,正常吗?如何才能保证不重复执行? 谢谢!

zjuwjf commented 4 years ago

这个是flutter本身的机制,和框架无关。 即使不用fish-redux也是如此。

SeptSky commented 4 years ago

这个是flutter本身的机制,和框架无关。 即使不用fish-redux也是如此。

感谢答复!