I/flutter (32618): one initState I/flutter (32618): one didChangeDependencies I/flutter (32618): one build
2. 页面数据更新
页面按钮点击或弹框处理,均不会涉及生命周期变化,只是在 build 更新 Widget 资源
1
I/flutter (32618): one build
但是若进行 热重载 生命周期如下
1 2 3
I/flutter (32618): one reassemble I/flutter (32618): one didUpdateWidget I/flutter (32618): one build
如果处于第二个页面的时候热重载
1 2 3 4 5
I/flutter ( 2535): one reassemble I/flutter ( 2535): two reassemble I/flutter ( 2535): one didUpdateWidget I/flutter ( 2535): one build I/flutter ( 2535): two build
3. 横竖屏切换
不会涉及生命周期变化
4. 切至后台
1 2
I/flutter (32618): one AppLifecycleState.inactive I/flutter (32618): one AppLifecycleState.paused
5. 切回前台
1
I/flutter (32618): one AppLifecycleState.resumed
6. 销毁页面
打开第二页面然后在退出
1 2
I/flutter ( 2535): two deactivate I/flutter ( 2535): two dispose
进阶场景
7. 打开新的页面
1 2 3
I/flutter ( 2535): two initState I/flutter ( 2535): two didChangeDependencies I/flutter ( 2535): two build
8. 新页面切至后台(旧页面未销毁)
1 2 3 4
I/flutter ( 2535): one AppLifecycleState.inactive I/flutter ( 2535): two AppLifecycleState.inactive I/flutter ( 2535): one AppLifecycleState.paused I/flutter ( 2535): two AppLifecycleState.paused
9. 新页面切回前台
1 2
I/flutter ( 2535): one AppLifecycleState.resumed I/flutter ( 2535): two AppLifecycleState.resumed
11.进入后台卡片页面
1 2
I/flutter ( 2535): one AppLifecycleState.inactive I/flutter ( 2535): one AppLifecycleState.paused
处于第二个页面时进入后台
1 2 3 4
I/flutter ( 2535): one AppLifecycleState.inactive I/flutter ( 2535): two AppLifecycleState.inactive I/flutter ( 2535): one AppLifecycleState.paused I/flutter ( 2535): two AppLifecycleState.paused
12. 进行分屏
1 2 3 4 5
I/flutter ( 2535): one AppLifecycleState.inactive I/flutter ( 2535): one AppLifecycleState.paused I/flutter ( 2535): one AppLifecycleState.resumed I/flutter ( 2535): one AppLifecycleState.inactive I/flutter ( 2535): one AppLifecycleState.resumed
如果处于第二个页面的时候分屏
1 2 3 4 5 6 7 8 9 10
I/flutter ( 2535): one AppLifecycleState.inactive I/flutter ( 2535): two AppLifecycleState.inactive I/flutter ( 2535): one AppLifecycleState.paused I/flutter ( 2535): two AppLifecycleState.paused I/flutter ( 2535): one AppLifecycleState.resumed I/flutter ( 2535): two AppLifecycleState.resumed I/flutter ( 2535): one AppLifecycleState.inactive I/flutter ( 2535): two AppLifecycleState.inactive I/flutter ( 2535): one AppLifecycleState.resumed I/flutter ( 2535): two AppLifecycleState.resumed
13.锁屏
1 2 3 4 5
I/flutter (32618): one AppLifecycleState.inactive I/flutter (32618): one AppLifecycleState.paused I/flutter (32618): one AppLifecycleState.resumed I/flutter (32618): one AppLifecycleState.inactive I/flutter (32618): one AppLifecycleState.paused
如果处于第二个页面的时候锁屏
1 2 3 4 5 6 7 8 9 10
I/flutter ( 2535): one AppLifecycleState.inactive I/flutter ( 2535): two AppLifecycleState.inactive I/flutter ( 2535): one AppLifecycleState.paused I/flutter ( 2535): two AppLifecycleState.paused I/flutter ( 2535): one AppLifecycleState.resumed I/flutter ( 2535): two AppLifecycleState.resumed I/flutter ( 2535): one AppLifecycleState.inactive I/flutter ( 2535): two AppLifecycleState.inactive I/flutter ( 2535): one AppLifecycleState.paused I/flutter ( 2535): two AppLifecycleState.paused
14.解锁
1
I/flutter (32618): one AppLifecycleState.resumed
如果处于第二个页面的时候锁屏在解锁
1 2
I/flutter ( 2535): one AppLifecycleState.resumed I/flutter ( 2535): two AppLifecycleState.resumed